vouch-opensource / krell

Simple ClojureScript React Native Tooling
Eclipse Public License 1.0
673 stars 37 forks source link

Error loading namespace on first run of new project #112

Closed bpringe closed 3 years ago

bpringe commented 3 years ago

I came across this having started multiple new projects while learning lately, and have verified I can reproduce consistently. I'm following the reagent tutorial in the wiki. Each time I follow the tutorial on a fresh new project, the first time I run npx react-native run-android (after having completed/run the previous steps), the emulator loads but says "Waiting for Krell to load files."

In the terminal where Metro is running (npx react-native start), I see the following logs and errors.

[Wed Dec 16 2020 11:08:40.956]  LOG      Running "AwesomeProject" with {"rootTag":1}
[Wed Dec 16 2020 11:08:40.957]  LOG      Connected to Krell REPL Server
[Wed Dec 16 2020 11:08:41.381]  LOG      Krell cache is up-to-date
[Wed Dec 16 2020 11:08:41.754]  LOG      Bootstrap from cache failed: [TypeError: undefined is not an object (evaluating 'KRELL_CACHE.get(toPath("goog/deps.js")).source')]
[Wed Dec 16 2020 11:08:41.764]  LOG      Namespace awesome_project.core not loaded, fetching: null
[Wed Dec 16 2020 11:08:41.766]  ERROR    goog.require could not find: awesome_project.core
[Wed Dec 16 2020 11:08:41.869]  ERROR    Error: goog.require could not find: awesome_project.core

If at this point I just re-run npx react-native run-android (without even killing Metro), the app then loads fine in the emulator - "Hello Krell!"

I'm on Manjaro Linux.

I'd say this isn't high priority since it always works on the second run and thereafter, but it could be a steady source of confusion for newcomers (and questions).

bpringe commented 3 years ago

I'm guessing maybe something is undefined on first run, when it's expected not to be:

TypeError: undefined is not an object (evaluating 'KRELL_CACHE.get(toPath("goog/deps.js")).source')
Namespace awesome_project.core not loaded, fetching: null
swannodette commented 3 years ago

Have you tried master? I'm just closing out old issues like this one because most old bugs are unlikely to be relevant anymore.

bpringe commented 3 years ago

I haven't worked on a Krell project in a while, but hopefully it's fixed since then. Thanks.