Fork me on GitHub
#cljsrn
<
2022-06-06
>
Zeniten09:06:41

I'm having an issue when adding new JavaScript components, @joshmiller. I've added an issue: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook/issues/1 (It seems very similar to this: https://github.com/vouch-opensource/krell/issues/142)

joshmiller15:06:17

Did you see the issue on just the bare skeleton, or did it only happen when you added a second component?

joshmiller15:06:43

I would definitely try to rm -rf node_modules && yarn install and try again as well.

Zeniten15:06:47

I've done a couple of other things as well, like adding a newer version of react-native-tcp-socket (https://github.com/vouch-opensource/krell/issues/148), and making some changes to styling. I've tried removing node_modules and running yarn install, and it seems to remove the error, but I then had problems with Metro/REPL not picking up changes. I was able to get everything to work again by reinstalling the REPL dependencies (`clj -M -m cljs.main -co "{:deps-cmd \"yarn\"}" --install-deps`), but that is quite cumbersome, and it appears I get the mentioned error again if I add another JS component.

joshmiller15:06:42

I believe when you do that reinstalling REPL deps step, it’s actually going to overwrite your upgraded react-native-tcp-socket version, along with possibly your react-native version, so I would double-check that.

Zeniten15:06:24

Yeah, it does, so I also did upgrade that specific library afterwards.

joshmiller15:06:38

I’m not surprised about the error itself, but more surprised that you have it working, then you add a component, and then it fails.

Zeniten15:06:04

(Before I tried adding another component, that is.)

👍 1
Zeniten15:06:36

Oh, btw, I had trouble installing Watchman when setting up RN, so I skipped that. I'm quite new to RN, so I'm not sure how crucial it is.

joshmiller15:06:49

Oh, that might be an issue. Watchman is what the bundler uses to detect new changes and include them in the build. It might not be picking up your new component.

👍 1
joshmiller15:06:07

If you have a working project and add a component to it, can you try quitting everything, then running yarn run-android and clj -M -m krell.main -co build.edn -c -r again?

👍 1
Zeniten16:06:43

Yeah, got the error.

Zeniten16:06:47

Ah, I forgot to rename the component this time. 1 sec.

joshmiller16:06:05

Hm, one thing you should definitely change is that you’re nesting a Text component inside another Text

Zeniten16:06:24

I'll fix that too, and check.

👍 1
Zeniten16:06:07

I guess trying to get Watchman set up would be a nice next step. Also, I could try making changes in another editor. I've had some issues with Emacs and temporary files in the past.

👍 1
joshmiller16:06:25

What does target/krell_npm_deps.js look like?

Zeniten16:06:51

module.exports = {
  krellNpmDeps: {
    "../js/Welcome.js": require('../js/Welcome.js'),
    "../js/Component.js": require('../js/Component.js')  }
};

joshmiller16:06:09

Ok, so it looks like Krell is properly picking up your JS

👍 1
Zeniten17:06:28

I just tried making changes in VS Code. It didn't affect the issue.

Zeniten17:06:07

I'll try getting Watchman up an running sometime later.

👍 1
Zeniten19:06:42

I've installed Watchman, and tried again, but unfortunately the issue is still there. 😞

joshmiller23:06:18

@U9CU2PQPM Good news, bad news. I checked out the latest version of your repo and it ran fine for me:

👍 1
joshmiller23:06:08

I’m on macOS, so it’s very possible there’s some OS-level difference here.

👍 1
joshmiller23:06:59

Actually, I will say, it may be worth checking out your “broken” repo into a new directory and trying to run it from there. I once solved a bundler issue by doing that even after all the cache-clearing instructions failed.

Zeniten10:06:11

Alright, I'll try that.

Zeniten13:06:21

Bah, cloning into a new directory didn't solve it. I guess it's the OS then, or my previous history with mucking about with this install.

Zeniten19:06:44

Thanks for all your input, though, Josh! 🙂

joshmiller19:06:13

No problem! Sorry it's not working. Let me know if you give it another shot and want a hand.

👍 1