I've made a new project using the default template...
# compose-web
с
I've made a new project using the default template for a Compose Web from the Intelij IDEA. I get some generated code that represents a simple counter web page. However when I run that project with the jsBrowserRun command, I get this error: Cannot find module 'D:\Ktor\Testing\build\js\node_modules\upath\build\code\upath.js'. Please verify that the package.json has a valid "main" entry
o
I tried the template as is with 2 different version (compose 1.2.2 - kotlin 1.7.20, compose 1.3.0 - kotlin 1.8.0), gradle-7.5.1 and it works. Did you add any changes to the project? Or does it fail for you right away?
I checked my build/js/node_modules folder and I can see upath.js there. Could you please check if it’s really absent in your project/build folder?
с
Nope, I don't see that file, nor directory named 'code' within the build folder.
o
What if you create a simple k/js project from a template? w/o compose. Will it fail too? Compose shouldn’t affect those modules anyway. My guess is that the modules had not properly synced up.
с
I've just created a simple k/js Browser app and it's building without an error.
That Compose Web template seems to have an issue, because I haven't done anything after it's creation.
o
just try it again, create from a compose template. those modules are not related to compose and compose doesn’t do anything to sync up node_modules
с
The same error
This is the template that I've used
o
one more thing to try: the template by default uses an old version. in gradle properties you can update koltin to 1.8.0 and compose to 1.3.0 then it may require running ./gradlew kotlinUpgradeYarnLock
Does you k/js sample buid folder have that upath.js file?
с
I've updated kotlin and compose versions, but when I run that command afterwards I get an error
Can you print me your JAVA_HOME variable value
To compare
the version
o
it’s java 15 and I checked it on MacOs. I’ll try to check on windows later
с
I'm using 1.8.0, I was able to execute that command with success, but still same error when running jsBrowserRun from gradle
I think it has something to do with the Java version..will have to experiment a bit.. Thank you for your answers Oleksandr, I really appreciate it! 🙌