I am currently getting ```Module parse failed: The...
# webassembly
a
I am currently getting
Copy code
Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
Error: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
When I am compiling a multiplatform library with wasm targets I have added this to my
webpack.config.d
Copy code
var experiments = config.experiments || {}
experiments.topLevelAwait = true
But still the problem persists
Looks like this piece of configuration was missing
Copy code
wasm {
  browser {
    commonWebpackConfig {
       experiments = mutableSetOf("topLevelAwait")
    }
  }
}
311 Views