This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-15
Channels
- # adventofcode (80)
- # beginners (94)
- # biff (19)
- # cider (74)
- # clj-kondo (11)
- # cljs-dev (7)
- # clojure (110)
- # clojure-austin (3)
- # clojure-australia (1)
- # clojure-belgium (1)
- # clojure-china (1)
- # clojure-europe (83)
- # clojure-filipino (1)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (1)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (4)
- # clojure-sg (1)
- # clojure-taiwan (1)
- # clojure-uk (2)
- # cursive (3)
- # data-science (8)
- # datalevin (8)
- # emacs (18)
- # etaoin (5)
- # graalvm (1)
- # holy-lambda (3)
- # honeysql (1)
- # jackdaw (10)
- # java (10)
- # jobs (3)
- # luminus (9)
- # malli (106)
- # off-topic (88)
- # polylith (8)
- # portal (2)
- # re-frame (50)
- # reagent (11)
- # reitit (74)
- # remote-jobs (1)
- # shadow-cljs (46)
- # tools-deps (26)
- # xtdb (49)
Hi all! Has someone come across resolving errors re: goog
packages in React Native lately? I'm currently upgrading an application to 0.70.6 and was hit with an error metro trying to resolve ./app/goog.math.long.js
– I got around this by patching metro's resolver and made it ./out/goog.math.long.js
– but it seems that something is wrong still since it still complains about
ReferenceError: Property 'Long' doesn't exist, js engine: hermes
. I'm figuring this out myself but wanted to ask if someone has already been seeing this 🙂It seems that it is not loading the goog.math.long.js currently. That's probably causing the error.
OK. Something is expecting the output to be in directory "app" – but it is written to "out".
=> using output-dir "app" gives a new error 🙂
Now it's concatenating an absolute path with a URL. Maybe this is configuration related.
That error has to do with symbolication. The actual error is still
ERROR ReferenceError: Property 'Long' doesn't exist, js engine: hermes
OK. It's the Long.fromBits in goog.math.long.js that is causing the issue. Maybe Hermes does not have that.
OK - thanks! any ideas on the output dir? We had out
previously and it has worked earlier but now it does not.
Previously I had :output-dir "out"
– now I have :output-dir "app"
If I have output-dir "out" I get an error when it tries to resolve goog.math.long.js
Yeah, using "app" metro works
(I updated refs to out
=> app
from relevant places)
I don't mind having the output in app
so it's not a big deal, just threw me off since this had worked before.
Yes, the output gets written to out
as before, but for some reason metro gets "app" from out of nowhere and tries to resolve from it
=> switching shadow-cljs to output to "app" makes it all work again
@U05224H0W switching to es5 did not work – it still fails on
ERROR ReferenceError: Property 'Long' doesn't exist, js engine: hermes
Yes, i know 🙂
No, there was nothing like that happening
Yes, it seems that Hermes is missing something essential that goog.math.long expects to have
I can just opt out from Hermes for the time being, that is not a problem
So, the only question remains to be solved is that why does react native expect to have stuff written in "app" when we have been using "out" for many years without issues. This is not a shadow-cljs issue probably and I can live with just changing the output dir 😄
Thanks for your work on shadow-cljs. It's such a great tool 🙂
I had same issue awhile back and what Thomas advised for you helped me https://clojurians.slack.com/archives/C0E1SN0NM/p1665753992908259?thread_ts=1665725322.539589&cid=C0E1SN0NM
I did reset caches et al, and switching back made it work again. I can live without Hermes for the time being. Thanks for the info though!
Hm. Seems like requiring ["@mui/material/Box" :default Box]
works as expected, but ["@mui/material/Box$default" :as Box]
doesn't as any use of Box later will refer to https://cljs.github.io/api/cljs.core/Box
I can. Should it go to shadow-cljs issue tracker? And is that enough of a description, or should I make a minimal repo that shows the problem with package.json and everything?
Also noticed than in working cases too the resulting JS code is a bit different. The old style creating shadow.js.require()
calls and then referring to objects with names like modules$node_modules$$DefaultExport$index.default, while the new one will skip the require and refer to shadow.js.shim.module$$DefaultExport$default.
I tried looking at the issues around the time this changed in the docs (Feb 20), but didn't find anything, so I wonder what the implications are. At first I thought that both styles would result in identical code, so I guess the translation is happening at a different place?
should be easy to reproduce. I think I already know the problem so just an issue as a reminder is enough
https://github.com/thheller/shadow-cljs/issues/1075. Thanks for the quick confirmation