Fork me on GitHub
#clojurescript
<
2023-05-01
>
Rambabu Patina05:05:06

Hi Team, I have a question, Where does the fulcro app looks for the dependent react library source code? because for some commonjs modules (which has index.js file in lib folder) it could not able to find the source and getting `Use of undeclared Var fulcro-atlaskit.testkit/Box.` Thanks in Advance

p-himik08:05:54

As far as I'm aware, Fulcro is a library/framework so it doesn't occupy itself with dependencies. What does though, is your dependency management tool. Maybe tools.deps (via deps.edn), maybe Lein (via project.clj) or maybe shadow-cljs (via shadow-cljs.edn), or maybe something else. fulcro-atlaskit is a library separate from Fulcro. And its source code doesn't have the testkit namespace, so it seems that whatever place you're getting that fulcro-atlaskit.testkit line of code from, it uses a potentially outdated version of that library.

Rambabu Patina14:05:36

You are right, we are using shadow-cljs (added fulcro-atlaskit library dependency in deps.edn). We have added the name space fulcro-atlaskit.testkit in fulcro-atlaskit library recently and we see that the dependencies are installed, compiled in our project. But not sure why it's unable to find the component in that namespace while consuming. Any idea?

p-himik14:05:42

Just to make sure - what is the repo for fulcro-atlaskit?

p-himik14:05:25

And exactly did you add that dependency to your deps.edn?

Rambabu Patina14:05:46

fulcro-atlaskit is on separate repository. And added that dependency in our current project deps.edn

xxxxxcorp/fulcro-atlaskit {:git/url "[email protected]:xxxxxcorp/fulcro-atlaskit"
                                       :sha "d6e5e097062374fcad6ec8f5128abe01fafb1258"}

Rambabu Patina14:05:14

This commit (d6e5e097062374fcad6ec8f5128abe01fafb1258) has the latest changes

p-himik14:05:51

If that source code is private, I don't really know how to help. I assumed it was public because I found an existing repo that's also named fucro-atlaskit.

Rambabu Patina14:05:21

It is a public repo, mohamicorp/fulcro-atlaskit. Please review

p-himik15:05:52

So that SHA points to the feature/NH-193 branch. When you navigate to https://github.com/mohamicorp/fulcro-atlaskit/tree/feature/NH-193/src/fulcro_atlaskit you'll see that there's no testkit.cljs or testkit.cljc file in there. So where is that fulcro-atlaskit.testkit namespace supposed to come from?

Rambabu Patina15:05:25

I masked the actual namespace name, it is fulcro-atlaskit.fuegokit

Rambabu Patina15:05:46

Problem is with consuming fuegokit

p-himik15:05:28

...why are you making the job of those whom you ask for help harder?

p-himik15:05:59

Alright, and that namespace has no Box. What is that supposed to actually be?

Rambabu Patina15:05:27

Sorry for that, I masked it due to privacy

p-himik15:05:55

I have a suggestion - create a minimal reproducible example in a separate repo, share it, and I'll take a look.

p-himik15:05:09

The code in that ns has a comment ;;(def ui-box (react-interop/react-factory Box)). Is that the Box you were talking about? If so, then where do you expect for it to come from? There's no :require for it and no alias usage.

Rambabu Patina15:05:22

I have created another public repo to isolate the issue at https://github.com/mohamicorp/fulcro-app and added readme to reproduce the issue.

Rambabu Patina15:05:31

Box can be named import from "@fuegokit/react" such as ["@fuegokit/react" :refer [Box]]

p-himik15:05:24

Might be related to https://clojurians.slack.com/archives/C6N245JGG/p1669756069405939 (see the original message in the main channel before the "hmm?"). but not sure.

p-himik15:05:41

No clue whether Thomas had made any changes in this regard.

p-himik15:05:06

I also can't build fulcro-app that you shared because it relies on artifacts from a private NPM repository. It also uses an outdated format for package-lock.json (when was the last time your updated npm?) which game me a crapton of warnings and HTTP 404 errors.

Rambabu Patina15:05:21

Apologies for that, there are few private npm repositories. Will check the possibility to share. My npm version is 6.14.17. Could be the issue with npm version?

p-himik15:05:03

Your npm is old, but it has nothing to do with the Box issue. And please don't share with me private stuff. What you should do instead is create a truly minimal reproducible example, ideally one that doesn't even need NPM. That way, you'll also be able to try different build tools and check whether the problem is with CLJS itself or with shadow-cljs. If it's the former, a new thread in #C03S1L9DN is warranted. If the latter - it would definitely be more suited for #C6N245JGG.

Rambabu Patina15:05:13

Sure, I will try that. Thanks @U2FRKM4TW for your time. Appreciate your help.

👍 1