0
System description:
macOS Big Sur ver. 11.4
MacBook Pro
Processor: 2.4
Mem: 8GB
Graphics: Intel Iris 1536 MB

Webpack-dev-server compiler 2 issues during the installation process.

1st issue.

npm run start

> create-wasm-app@0.1.0 start /Users/name/RUSTWASM/TUTORIAL/gameoflife/www
> webpack-dev-server

/Users/name/RUSTWASM/TUTORIAL/gameoflife/www/node_modules/schema- 
utils/dist/validate.js:105
throw new _ValidationError.default(errors, schema, configuration);
^

ValidationError: Invalid options object. Copy Plugin has been initialized using 
an options object that does not match the API schema.

**2nd Issue

The module seem to be a WebAssembly module, but module is not flagged as WebAssembly 
module for webpack.
Jarosław Cichoń
  • 542
  • 1
  • 4
  • 8

1 Answers1

1

1st issue

I have found a solution for that issue here. npm run dev fails : ValidationError: Invalid options object

It's a webpack config syntax error:

Old syntax:

new CopyWebpackPlugin(
  [
    { from: '', to: '' },
    { from: '', to: '' }
  ]
)

New syntax:

new CopyWebpackPlugin(
  { 
    patterns: [
      { from: '', to: '' },
      { from: '', to: '' }
    ]
  }
)

2nd issue

The solution for the second issue is inside this file: webpack.config.js according to Can not use web-assembly rust impl because of 'Cannot access '__wbindgen_throw' before initialization' error

experiments: {
    syncWebAssembly: true // !! <- use syncWebAssembly instead of asyncWebAssembly
},

Full working code here. https://github.com/cichy/gameoflife

Jarosław Cichoń
  • 542
  • 1
  • 4
  • 8