Hello, I'm using the latest version of krell and react-native 0.75.4, I'm trying to reference code from https://github.com/wix/react-native-calendars but I get the error in the screenshot; I saw that previously in the chat someone suggested to edit the main field of the package.json of node_modules/react-native-calendars from index.ts to index.js but it doesn't seem to fix the issue for me and seems also a bit buggy. Any idea on what it the problem and if is there a fix for this situation?
What does your require look like in your namespaces declaration in cljs?
hey @joshmiller thanks for replying! My require is like this
(:require
[react-native-calendars :as react-native-calendars])Maybe put it in quotes, (`”react-native-calendars”`)? Also you have rebuilt with krell after adding it?
I'm afraid that I tried that already but it didn't solve the issue, anyway I'm going to try right now again
about rebuild krell, do you mean to run clj -M -m krell.main -co build.edn -c -r again?
If that doesn’t work, also check what (js/require “react-native-calendars”) from the cljs repl gives you
I get nil . I'll try to setup a new project from zero with just react-native-calendars dep just to see if in that case it works
I just tried with a new repo with only react-native-calendars dependency and the issue is still there, could it make sense if I open an issue with a link to the repo on krell repo?
I don’t think Krell will do anything without actually diagnosing an issue. Can you put that repo up on GitHub and link me? I’m on a plane right now but I’ll see if I can see what is going on there.
sure and thanks!
here it is https://github.com/glippi/krell-calendars
fyi @joshmiller I'll log off now so if I don't reply is for this reason. I'll be back on Monday, I'm not sure if I'll log in in the weekend. Thank you very much again for looking into this weird issue, hopefully we'll figure out what's the problem soon ;)
Great, enjoy your weekend.
I see, thank you very much!
Steps:
1. Check out that repo
2. yarn install
3. Edit package.json in node_modules/react-native-calendars to reference index.js instead of index.ts
4. npx pod-install
5. clj -M -m krell.main -co build.edn -c -r
6. yarn ios
@joshmiller thank you very much! Do you know why it's needed to change index.ts to index.js ?
I haven’t dug down to actually fix this when it comes up yet, but I believe it’s because the Closure compiler doesn’t understand TypeScript and at this stage of development we haven’t passed through the Metro bundler yet.
I think most TS-built projects go through a compile step and point to index.js, not sure why there are a couple that do not