After upgrading to Kotlin `2.2.20-Beta2` some of m...
# javascript
r
After upgrading to Kotlin
2.2.20-Beta2
some of my tests no longer work with a strange webpack error. See đź§µ
Copy code
UnhandledRejection: TypeError: The 'compilation' argument must be an instance of Compilation
    at JavascriptModulesPlugin.getCompilationHooks (/home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:210:10)
    at SourceMapDevToolModuleOptionsPlugin.apply (/home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/SourceMapDevToolModuleOptionsPlugin.js:44:27)
    at /home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/SourceMapDevToolPlugin.js:183:53
    at Hook.eval [as call] (eval at create (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/Hook.js:16:14)
    at Compiler.newCompilation (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1303:26)
    at /home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1347:29
    at Hook.eval [as callAsync] (eval at create (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/Hook.js:20:14)
    at Compiler.compile (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1342:28)
TypeError: The 'compilation' argument must be an instance of Compilation
    at JavascriptModulesPlugin.getCompilationHooks (/home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:210:10)
    at SourceMapDevToolModuleOptionsPlugin.apply (/home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/SourceMapDevToolModuleOptionsPlugin.js:44:27)
    at /home/rjaros/git/kilua/build/wasm/node_modules/webpack/lib/SourceMapDevToolPlugin.js:183:53
    at Hook.eval [as call] (eval at create (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:100:1)
    at Hook.CALL_DELEGATE [as _call] (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/Hook.js:16:14)
    at Compiler.newCompilation (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1303:26)
    at /home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1347:29
    at Hook.eval [as callAsync] (eval at create (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/tapable/lib/Hook.js:20:14)
    at Compiler.compile (/home/rjaros/.kotlin/kotlin-npm-tooling/npm/0e8af1ba763e2a6bb176b6e17636dac8/node_modules/webpack/lib/Compiler.js:1342:28)
b
Hi! Hopefully this should be fixed in 2.2.20-RC, which is just around the corner. Could you please try running your tests with
2.2.20-RC-230
?
thank you color 1
r
I need KSP for my project so I don't know if it's possible.
b
Should be possible, you can try to ignore the warning about KSP version mismatch and see if it works.
r
Will try that. Thanks.
b
If it doesn't work for you, you can try cleaning the Gradle cache (
rm -rf ~/.gradle
).
r
What maven repo should I add to use dev kotlin version?
b
<https://redirector.kotlinlang.org/maven/dev/>
Correction: the version should be
2.2.20-RC-233
.
r
Unfortunately it still doesn't work. The same error with RC-233. It only fails with
wasmJsBrowserTest
so I should probably post this to #CDFP59223 channel.
b
Thanks for trying out the RC! Seems like this story is not over yet…
I should probably post this to #CDFP59223
It doesn't matter really: both Kotlin/JS and Kotlin/Wasm use the same set of NPM dependencies, with the same versions. I'd appreciate if you could create a ticket though: kotl.in/issue. Even better if you could attach your project.
Js browser tests are not working as well, so I've changed the title of the issue.
b
Thank you!