peekandpoke
09/24/2020, 6:59 AMgradle -t assemble
for continuous building.
But as soon as I change some code I get this error:
Failed to compile.
(webpack)-dev-server/client?<http://localhost:8888>
Module build failed (from /PROJECT/build/js/node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open '/PROJECT/build/js/node_modules/webpack-dev-server/client/index.js'
I checked what is going on and indeed there is no webpack-dev-server present in build/js/node_modules folder.
I should also mention that I have multiple JS modules in my project. So maybe they all write to the build/js/node_modules directory and interfere with each other, as they have different configurations. But even when only building a single module the problem stays the same.
I then tried to be sneaky and added this to one of the build.gradle files
testImplementation npm("webpack-dev-server", "3.11.0")
Which in fact solves the issue with reload in so far, that the error does no longer show up and that in build/js/node_modules there truely is the webpack-dev-server dependency.
But now the problem is: The page is reloading on code changes -> Good -> BUT: the changes are not picked up -> BAD
Does anyone have an idea what to look for or some workaround?
Thank you for reading 🙂peekandpoke
09/24/2020, 7:58 AM./gradlew :myapp:browserProductionRun
By default the browserDevelopmentRun is used when you do
./gradlew :myapp:run
I then did some changes to my code the are easy go grep for. So before the a code change things look like this:
grep -r '!!!---!!!---!!!' *
build/js/packages/myapp/kotlin-dce/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login !!!---!!!---!!!');
build/js/packages/myapp/kotlin/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login !!!---!!!---!!!');
build/js/packages/myapp/kotlin-dce-dev/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login!!!---!!!---!!!');
myapp/src/main/kotlin/features/login/ui/LoginPage.kt: ui.header H3 { +"Login !!!---!!!---!!!" }
When I then change some code and grep again we see this:
grep -r '!!!---!!!---!!!' *
build/js/packages/myapp/kotlin-dce/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login !!!---!!!---!!!---CHANGED');
build/js/packages/myapp/kotlin/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login !!!---!!!---!!!---CHANGED');
build/js/packages/myapp/kotlin-dce-dev/thebase-web-adminapp.js: $receiver.unaryPlus_pdl1vz$('Login!!!---!!!---!!!');
myapp/src/main/kotlin/features/login/ui/LoginPage.kt: ui.header H3 { +"Login !!!---!!!---!!!---CHANGED" }
As you can see: the change is NOT picked by the kotlin-dce-dev . And the :browserDevelopmentRun looks into this directory.
And the changes are picked up by kotlin-dce which is used by :browserProductionRun
Sooo... What can I do about this. I have the workarounds but surely a real fix would be nice. How do I proceed? File a bug? Someone picking this one up?
Thanks!Ilya Goncharov [JB]
09/24/2020, 8:45 AM:myapp:run
, do you have only browser()
in myapp
?
Do you have your project open to debug it?peekandpoke
09/24/2020, 9:29 AM./gradlew -t :myapp:assemble :myapp:processDceDevKotlinJs
then the changes are picked up and the reload works.peekandpoke
09/24/2020, 9:32 AM{
"private": true,
"workspaces": [
"packages/myapp"
],
"devDependencies": {},
"dependencies": {},
"peerDependencies": {},
"optionalDependencies": {},
"bundledDependencies": [],
"name": "thebase-web",
"version": "0.1.0"
}
peekandpoke
09/24/2020, 9:32 AMpeekandpoke
09/24/2020, 9:33 AM