CLOVIS
09/13/2026, 7:47 AMmocha when using kotlin.js.yarn=false ?
Server start failed on port 9876: Error: Cannot find module 'mocha'
Require stack:
- /home/ivan/Projects/opensavvy/playground/build/js/node_modules/karma-mocha/lib/index.js
- /home/ivan/Projects/opensavvy/playground/build/js/node_modules/karma/lib/plugin.js
- /home/ivan/Projects/opensavvy/playground/build/js/node_modules/karma/lib/server.js
- /home/ivan/Projects/opensavvy/playground/build/js/node_modules/karma/lib/cli.js
- /home/ivan/Projects/opensavvy/playground/build/js/node_modules/karma/bin/karma
> Task :gradle:templates:template-app:jsBrowserTest FAILEDAnton Lakotka [JB]
09/13/2026, 11:01 AMAdam S
09/13/2026, 8:41 PMkotlin.js.yarn=false? Changing it (and not deleting the build dir) can cause npm to not hoist dependencies in the package-lock.json file. And annoyingly this won't immediately cause problems - npm will keep the currently-installed modules, but then later after a fresh checkout it'll use the 'corrupted' non-hoisted lockfile, which will cause issues when KGP assumes common dependencies are hoisted.
More info here: https://youtrack.jetbrains.com/issue/KT-88943/KJS-Gradle-npm-install-into-a-leftover-nodemodules-produces-a-placement-dependent-package-lock.json-failing
It's something that must be fixed in KGP. The current workaround is to delete the lockfile, delete the build dir, then regenerate the lockfile.CLOVIS
09/14/2026, 7:03 AMDid you recently changeNo, it's been at least 6 months?kotlin.js.yarn=false
CLOVIS
09/14/2026, 7:04 AMCLOVIS
09/14/2026, 7:05 AMIt's something that must be fixed in KGP. The current workaround is to delete the lockfile, delete the build dir, then regenerate the lockfile.The problem survives that 😕