photon icon indicating copy to clipboard operation
photon copied to clipboard

Webpack import problem

Open nebnes opened this issue 3 years ago • 2 comments

I am trying to import photon in a existing web project. Here is my webpack loader.

{
        test: /\.wasm$/,
        use: [
            {
                loader: 'file-loader',
            },
        ],
        type: 'javascript/auto',
    }

I get this error :

./node_modules/@silvia-odwyer/photon/photon.js
Attempted import error: '__wbg_photonimage_free' is not exported from './photon_bg.wasm' (imported as 'wasm').

Have you an example to import photon ?

nebnes avatar Mar 19 '21 14:03 nebnes

have you set

experiments: {
    syncWebAssembly: true,
}

in your webpack.config.js?

coulson84 avatar Apr 23 '21 05:04 coulson84

have you set

experiments: {
    syncWebAssembly: true,
}

in your webpack.config.js?

Work for me. I use webpack 5 without external wasm loader but only add options syncWebAssembly: true

Gavin-Gong avatar Jul 13 '21 14:07 Gavin-Gong