Skip to content

Error when trying to use this in WebPack. #8

@chr15m

Description

@chr15m

Hi @feross - I know you're very busy so hopefully this won't take much of your time.

When I try to do a simple import * as timidity from "timidity"; and then run that file through webpack I get the following 2 errors:

ERROR in ./node_modules/timidity/libtimidity.wasm
Module not found: Error: Can't resolve 'env' in '/home/chrism/dev/something/node_modules/timidity'
 @ ./node_modules/timidity/libtimidity.wasm
 @ ./node_modules/timidity/index.js
 @ ./src/js/index.js

ERROR in ./node_modules/timidity/libtimidity.wasm
WebAssembly module is included in initial chunk.
This is not allowed, because WebAssembly download and compilation must happen asynchronous.
Add an async splitpoint (i. e. import()) somewhere between your entrypoint and the WebAssembly module:
* ./src/js/index.js --> ./node_modules/timidity/index.js --> ./node_modules/timidity/libtimidity.wasm

I'm not a heavy webpack user but maybe you have some pointers as to how I can fix this? Will issue a PR if I get it working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions