gl-matrix-wasm icon indicating copy to clipboard operation
gl-matrix-wasm copied to clipboard

Critical dependency error

Open t1gor opened this issue 3 years ago • 3 comments

Hello, @dtysky !

I've came across this lib and would like to use it as a replacement for gl-matrix on one of our projects. Currently facing the issue right after the installation via npm:

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Could you please hint me on what am I doing wrong?

gl-matrix-wasm version: 0.8.0

Webpack confing:

module.exports = (env, argv) => {
  return {
    target: 'web',
    module: {
      rules: [
      ...
        {
          test: /\.wasm$/,
          type: 'webassembly/async'
        }
      ]
    },
    experiments: {
      asyncWebAssembly: true,
    },
   ...
  };
};

t1gor avatar Sep 07 '22 08:09 t1gor

Could you use the "One JS file" mode?

dtysky avatar Sep 09 '22 05:09 dtysky

I would really prefer to only load what is about to be executed, but I can try as an experiment. Will drop you a line when have some results.

t1gor avatar Sep 09 '22 06:09 t1gor

I would really prefer to only load what is about to be executed, but I can try as an experiment. Will drop you a line when have some results.

Dose "webpack dynamic module" solve your problme ?

dtysky avatar Sep 09 '22 06:09 dtysky