Is anyone else having problems with `mocha` when u...
# javascript
c
Is anyone else having problems with
mocha
when using
kotlin.js.yarn=false
?
Copy code
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 FAILED
a
Is it reproducible for karma test runner? Ill check on monday.
a
Did you recently change
kotlin.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.
c
Did you recently change
kotlin.js.yarn=false
?
No, it's been at least 6 months
This is the branch I see it on: gitlab.com/opensavvy/…/185 However, it doesn't reproduce in CI (clean install)
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.
The problem survives that 😕