Robert Jaros
10/14/2023, 5:31 PMkotlinx.datetime
I've got:
> Task :wasmJsBrowserTest
404: /absolute/tmp/_karma_webpack_461787/node_modules_js-joda_core_dist_js-joda_esm_js.js
(error: /tmp/_karma_webpack_461787/node_modules_js-joda_core_dist_js-joda_esm_js.js)
at __webpack_require__.f.j (/tmp/_karma_webpack_461787/runtime.js:300:29)
at /tmp/_karma_webpack_461787/runtime.js:161:40
at Array.reduce (<anonymous>)
at __webpack_require__.e (/tmp/_karma_webpack_461787/runtime.js:160:67)
at instantiate (<webpack://kilua-wasm-js-test/./kotlin/kilua-wasm-js-test.uninstantiated.mjs?:17:93>)
at eval (<webpack://kilua-wasm-js-test/./kotlin/kilua-wasm-js-test.mjs?:9:156>)
at __webpack_require__.a (/tmp/_karma_webpack_461787/runtime.js:91:13)
at eval (<webpack://kilua-wasm-js-test/./kotlin/kilua-wasm-js-test.mjs?:1:21>)
at ./kotlin/kilua-wasm-js-test.mjs (load.286322405.js:18:1)
at Function.__webpack_require__ (/tmp/_karma_webpack_461787/runtime.js:31:41)
I'm on Kotlin 1.9.20-Beta2.Ilya Goncharov [JB]
10/16/2023, 1:57 PMwebpack
, but looks like it doesn’t.
So probably it is another problem.
As I understand it is because webpack processing all dynamic imports as separate files. But Karma has problem with emitting more than one file from webpack. So I will investigate how we can fix Karma in such casesoptimization
field).
It is necessary source maps to work correctly. But it is more actual for Kotlin/JS. So in Kotlin/Wasm I think it can be deleted (yes, source maps will be wrong in such case in Kotlin/Wasm)
Workaround is following: create karma.config.d
to create custom script inside Karma config.
Create file under this folder, for example index.js
with content
delete config.webpack.optimization
It should fix problem with loading of separate files for testing purposes.
Just as additional information, I understand the reason why karma
needs its own optimization
setting, and looks like I understand how it can be possible to work source maps with their setup, so I hope it will work in next releases.Robert Jaros
10/19/2023, 11:26 AM