Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2522

Realm crashes on hot reload in React Native

      How frequently does the bug occur?

      Always

      Description

      The app crashes after 1 or 2 hot reloads with the error Access to invalidated Results objects, even though the code changes had nothing to do with Realm, like only changing styles and components

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      ERROR  Error: Exception in HostFunction: Access to invalidated Results objects, js engine: hermes
      Error: ENOENT: no such file or directory, open 'D:\Code\Projects\RealmHotReloadCrash\JavaScript'
          at Object.openSync (node:fs:585:3)
          at Object.readFileSync (node:fs:453:35)
          at getCodeFrame (D:\Code\Projects\RealmHotReloadCrash\node_modules\metro\src\Server.js:879:18)
          at Server._symbolicate (D:\Code\Projects\RealmHotReloadCrash\node_modules\metro\src\Server.js:962:22)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at async Server._processRequest (D:\Code\Projects\RealmHotReloadCrash\node_modules\metro\src\Server.js:418:7) {
        errno: -4058,
        syscall: 'open',
        code: 'ENOENT',
        path: 'D:\\Code\\Projects\\RealmHotReloadCrash\\JavaScript'
      }
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      1. Pull my repo
      2. Start the development environment with yarn start and yarn android
      3. Open the app on your phone
      4. Open the project in any editor
      5. Now make any changes to the code, for example changing some values in the styles, like 'black' to 'red'
      6. Hit save, the hot reload will occur
      7. The app will crash and the error will appear in the terminal
      8. If it doesn't crash, then just make some more changes and save again, it will eventually happen, most of the time it took me 1 save to crash but sometimes it takes 2 saves

      Version

      ^11.9.0

      What services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      Android 13.0.3

      Build environment

      I built the app in Windows 10, connected to physical phone through USB debugging to install and debug the app

      Cocoapods version

      No response

            Assignee:
            andrew.meyer@mongodb.com Andrew Meyer
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: