Hello. my multiplatform Compose-web app is not pic...
# compose-web
r
Hello. my multiplatform Compose-web app is not picking up the
index.html
I get completely blank error state screen
Further when I run the
./gradlew build
only
Production executable
is produced in the buildFolder Even when I try to run
./gradlew jsBrowserProductionRun
I still face the same issue of
index.html
not getting loaded
b
Do you have index.html in your js resources?
r
Yes
b
What's its path relative to module root?
r
its in
src/jsMain/resources/index.html
b
That's correct. Then I suspect you have something else running on port 8080 prior to starting
./gradlew  jsBrowserRun
Do you have any backend services that your webapp depends on (8080 is standard backend port in most frameworks)
r
no. currently its simple static page only
b
Here's how to change the port to avoid collisions. https://github.com/mpetuska/kmdc/blob/master/sandbox/build.gradle.kts#L29
Can you also send me a screenshot of browser network tab after refreshing the page with devtools open?
r
I have shut down the process. And again building it. Will share it after reloading the same process
b
Few more things to check in the terminal where you started gradle: • Did gradle build complete with no errors? • Did webpack dev server start without errors?
r
both of these are true
saying from the information of previous executions
b
Is your project open-source so I could have a peek at your config?
If not, send me your build.gradle.kts file if you can.
r
I can share the build.gradle.kts. Its not open source though 😐
👍 1
here is the network tab
b
Along with your build.gradle.kts file, it would be helpful if you could send me terminal output of
./gradlew jsBrowserRun
r
Yes doing it . just few minutes
b
No rush 🙂
r
Now I am able to load the page. But this happens Problem was I had three modules for Js jsMain for Composables webMain for Shared module jsMain for webApp (Main front end) now
./gradlew jsBrowserRun
was only trying to run
composables.js
which caused the issue Solution I changed the sourceSet name for webApp to
frontMain
it worked but it caused the below issue
b
Odd, these warnings are quite commonplace with K/JS projects, but they shouldn't pevent your app from loading up.
I'm afraid I've exhausted my expertise here, without having access to your project.
r
hmm understandable
Thanks for the help But surely I was able to take a few step ahead from the originl probalem
One more information if it helps Its actually
productionRun
which is showing above message but development run works fine
b
Ah, makes sense. productionRun task shouldn't even be there...
r
productionRun task shouldn't even be there...
Why is that ?
b
The task itself makes no sense. You only need developmentRun to spin up dev server while developing and productionBundle to minimize your files and prepare them for deployment.
If you want to run bundled version just open up index.html file in build/distribution after running productionBundle
r
yeah thats working