Fork me on GitHub
#cljsrn
<
2022-10-26
>
Andres13:10:40

Hello, I am trying to run a Krell instance to experiment with CLJS/React Native. I have been following this tutorial : [https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial](https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial) When I try to do an android or ios build I get this error :

BUNDLE  ./index.js

error: Error: Unable to resolve module react/jsx-runtime from /Users/dedegogo/workspaces/react-native-apps/lnd/index.js: react/jsx-runtime could not be found within the project or in these directories:
  node_modules
> 1 | /* Generated by Krell, do not edit by hand */
  2 |
  3 | import React from 'react';
  4 | import {
    at ModuleResolver.resolveDependency (/Users/dedegogo/workspaces/react-native-apps/lnd/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:178:15)
...
If I understand correctly the dependencies have not been installed (since they are not found) What should I do in order to resolve these dependencies issues? This is what I did : To install my dependencies I followed the tutorial: first I tried clj -M -m cljs.main --install-deps But it does not work. I get a depenency error, where it tries to find the latest react (18) but it only finds v.16. I also tried the same command with -Srepo but that did not change anything (my ~/.clojure/deps.edn is all commented text) So I tried this way as indicated: yarn install which installs some depndencies, then clj -M -m cljs.main -co "{:deps-cmd \"yarn\"}" --install-deps which does not return an error but does not print anything else in the console for info I have tried doing this with node 16 and 18 and npm 8.1.2 and 8.19.2 respectively. But I keep having the same errors when I try to install the deps using npm.

joshmiller18:10:46

What happens if you stop before the ClojureScript step and try to run the app as a plain JS project?

joshmiller18:10:47

Also there’s a template here that should set everything up for you, you could give it a try as well: https://github.com/joshuamiller/react-native-template-cljs-krell-storybook

🙌 2
Andres09:10:14

Thank you Josh, I tried the template and after some fiddling it worked great. It’s also great that you implemented storybook into the project as that is something I want to experiment with and learn too. Now that the pipes are working, I just have to learn react-native and figure out how it all works together.

🎉 1
Andres09:10:20

When I try the app as a plain JS project it worked fine. I also tried adding the dependencies manually and that led me to another error message :

LOG  Running "test" with {"rootTag":1,"initialProps":{}}
 ERROR  Error: @react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:
  • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.
  • Rebuild and re-run the app.
  • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
  If none of these fix the issue, please open an issue on the Github repository: , js engine: hermes
    at KrellRoot ()
    at RCTView
    at View
    at RCTView
    at View
    at AppContainer ()
    at test(RootComponent) ()
 ERROR  TypeError: Cannot read property 'krellUpdateRoot' of undefined

This error is located at:
    in KrellRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in test(RootComponent), js engine: hermes
 ERROR  TypeError: Cannot read property 'krellUpdateRoot' of undefined

This error is located at:
    in KrellRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in test(RootComponent), js engine: hermes
but then I saw your message. I will try to get it working or file a bug report to krell.

Andres09:10:28

Actually, after reinstalling the pods and relaunching the app, the IOS simulator launched properly. I just needed to keep digging.

2