https://kotlinlang.org logo
#webassembly
Title
# webassembly
a

andylamax

02/16/2023, 8:20 AM
I have the following setup in
build.gradle.kts
Copy code
wasm {
        browser()
        binaries.executable()
    }
with a single
index.kt
Copy code
fun main() {
  println("works")
}
when I run
./gradlew wasmBrowserDevelopmentRun
, it fails with
Copy code
Module build failed: UnhandledSchemeError: Reading from "node:module" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
Full error log is in thread. But how do I successfully run this test app??
Copy code
Module not found: Error: Can't resolve '.' in '/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/packages/astrix-astrix-app-browser-wasm/kotlin'

Module build failed: UnhandledSchemeError: Reading from "node:module" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
    at /media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/webpack/lib/NormalModule.js:832:25
    at Hook.eval [as callAsync] (eval at create (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/tapable/lib/Hook.js:18:14)
    at Object.processResource (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/webpack/lib/NormalModule.js:829:8)
    at processResource (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/loader-runner/lib/LoaderRunner.js:220:11)
    at iteratePitchingLoaders (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/loader-runner/lib/LoaderRunner.js:171:10)
    at runLoaders (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/loader-runner/lib/LoaderRunner.js:398:2)
    at NormalModule._doBuild (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/webpack/lib/NormalModule.js:819:3)
    at NormalModule.build (/media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/webpack/lib/NormalModule.js:963:15)
    at /media/andylamax/Auxilliary/Workspace/aSoft/home/astrix/build/js/node_modules/webpack/lib/Compilation.js:1371:12
42 Views