# javascript

Arjan van Wieringen

09/22/2023, 3:17 PM
Okay, I am running in quite some issues with a
project which I want to include in a React project. I have tried it 3 ways and only 1 works and I have no clue why. My feeling is that it is related to the INSANE JS module system. I would really appreciate some input. I have made a minimal reproduceable project for the 3 situations: 1. NPM + Create React App: This one works! Including source map support. However, CRA is deprecated and NPM is slow..... ( Just run
npm run dev
. 2. NPM + Vite Create React: This one results in
"useTodoViewModel" is not exported by "../build/js/packages/architecture-demo/kotlin/architecture-demo.js", imported by "src/main.tsx"
( Also run
npm run dev
3. PNPM + Vite Create React: This one works, but source map support isn't working. They are not resolvable and cause 404. Having source-map support is critical for development. I think it is related with how PNPM works (a central store). (, and run
pnpm run dev
I hope there are people who know how I can get nr.3 to work?

Edoardo Luppi

09/22/2023, 3:25 PM
I had issues with source maps resolution when they're under a
directory. That's why I always copy the build output to a
directory, and then use the workspace feature of package managers.
Linking a package via a specific protocol like
should have never been invented.
🙌 1
Also, personal note, stick with npm if you can, it reduces the overall complexity in mixed projects like these. Speed is decent, not as bad as years ago.

Arjan van Wieringen

09/22/2023, 3:31 PM
Thanks for all the tips! I’ll try it out