Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import the named export (imported as 'wasm') #143

Open
bart-krakowski opened this issue Dec 8, 2022 · 1 comment
Open

Can't import the named export (imported as 'wasm') #143

bart-krakowski opened this issue Dec 8, 2022 · 1 comment

Comments

@bart-krakowski
Copy link

bart-krakowski commented Dec 8, 2022

Hi!
I used wasm-pack build command and I'm getting the following error:

ERROR in ./src/wasm-lib/pkg/index_bg.js 15:14-29

wasm-pack-plugin: Can't import the named export (imported as 'wasm') from default-exporting module (only default export is available)

The ./src/wasm-lib/pkg/index_bg.js file is auto-generated and looks like this:

import * as wasm from './wasm_lib_bg.wasm';

/**
* @param {number} left
* @param {number} right
* @returns {number}
*/
export function sort_array(left, right) {
    const ret = wasm.sort_array(left, right);
    return ret >>> 0;
}

I also added the syncWebAssembly flag to my Webpack config.

@yeskiy

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants