Closed
Description
When trying to use this lib from npm in a React project, I get the error
Failed to compile.
./node_modules/drand-client/verifying.js 16:29
Module parse failed: Unexpected token (16:29)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| // TODO: switch to TinyGo when math/big works for smaller wasm file and non-global exports.
| const go = new Go();
> const url = `${import.meta.url.split('/').slice(0, -1).join('/')}/wasm/drand.wasm`;
| let result;
|
This is because import.meta.url is not supported in Webpack 4. Webpack 5 support probably will take some more time.
I have no great idea how to solve this, but let's see.
Metadata
Metadata
Assignees
Labels
No labels