This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-14
Channels
- # announcements (7)
- # aws (1)
- # babashka (1)
- # beginners (19)
- # calva (9)
- # clj-commons (4)
- # clj-kondo (64)
- # clj-on-windows (27)
- # cljsrn (12)
- # clojure (127)
- # clojure-bay-area (3)
- # clojure-europe (25)
- # clojure-hungary (7)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (5)
- # clojure-survey (2)
- # clojure-uk (22)
- # community-development (5)
- # core-async (19)
- # cursive (29)
- # datascript (8)
- # events (1)
- # fulcro (2)
- # graalvm (3)
- # jobs (1)
- # lsp (155)
- # malli (18)
- # nbb (6)
- # off-topic (86)
- # pathom (2)
- # rdf (18)
- # re-frame (9)
- # releases (2)
- # scittle (24)
- # shadow-cljs (33)
- # xtdb (4)
I had an RN app working over a year ago with RN 0.63.4 and tried to update everything to the most recent version of RN and shadow-cljs I can run the app with default App.js but if I switch to the shadow cljs build I get what looks like a path error:
Error: ENOENT: no such file or directory, open '/home/naomarik/sah/mobile-app/react-native/http:/localhost:8081/app/goog.math.long.js'
at Object.openSync (node:fs:599:3)
at Object.readFileSync (node:fs:467:35)
at getCodeFrame (/home/naomarik/sah/mobile-app/react-native/node_modules/metro/src/Server.js:1028:18)
at Server._symbolicate (/home/naomarik/sah/mobile-app/react-native/node_modules/metro/src/Server.js:1101:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Server._processRequest (/home/naomarik/sah/mobile-app/react-native/node_modules/metro/src/Server.js:458:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/naomarik/sah/mobile-app/react-native/http:/localhost:8081/app/goog.math.long.js' } ERROR ReferenceError: Property 'Long' doesn't exist, js engine: hermes
The file in question does exist and shadow-cljs compiles successfully.Hmm, manually fixing the path in index.js output removes the error but still leaves me this:
ERROR ReferenceError: Property 'Long' doesn't exist, js engine: hermes
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
Try adding :compiler-options {:output-feature-set :es5}
to https://shadow-cljs.github.io/docs/UsersGuide.html#_output_language_options
I haven’t had any luck with Hermes. My app doesn’t really benefit from its faster startup time (it’s already imperceptible) so I’ve just disabled it.
Just saw these replies, thanks @U051091NM that works!
@U05224H0W might be worth updating the shadow-cljs docs to include this point in the react native section? I'm not really familiar with the whole build process and this took me a long time to pinpoint disabling hermes, and would have never guessed it was as easy just to set the compiler option to es5 as dima suggested.
I don't use react-native and know nothing about hermes. no clue why setting :es5 would fix anything either. first time I hear about it
i haven't heard of it either, feels like the foundation to build mobile apps is built on a children ball pit and if you leave it for any amount of time you'll come back to pain
@U051091NM wow... this actually worked xD alright so fun times ahead. How did you figure this one out?
@U45SLGVHV on Hermes Language Features page it says they plan to target ES6 with some exceptions and then there is a list of supported and in-progress features so you could see what's missing