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

Error: Unexpected section: 0xfe #62

Closed
topheman opened this issue May 30, 2019 · 2 comments
Closed

Error: Unexpected section: 0xfe #62

topheman opened this issue May 30, 2019 · 2 comments

Comments

@topheman
Copy link

Hello,

I am using the wasm-bindgen crate in this project, which is really likely to your example project.

I've got wasm-pack@0.8.1 installed and wasm-tool/wasm-pack-plugin@0.4.2

If I upgrade wasm-bindgen to v0.2.35 and above, I get the following error in webpack :

ERROR in ./crate/pkg/ball_wasm_bg.wasm
Module parse failed: Unexpected section: 0xfe
You may need an appropriate loader to handle this file type.
Error: Unexpected section: 0xfe
    at new CompileError (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/@webassemblyjs/helper-api-error/lib/index.js:40:109)
    at parseSection (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:1542:11)
    at Object.decode (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/@webassemblyjs/wasm-parser/lib/decoder.js:1559:25)
    at decode (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/@webassemblyjs/wasm-parser/lib/index.js:240:21)
    at WebAssemblyParser.parse (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/webpack/lib/wasm/WebAssemblyParser.js:74:19)
    at doBuild.err (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/webpack/lib/NormalModule.js:460:32)
    at runLoaders (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/webpack/lib/NormalModule.js:342:12)
    at /Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/loader-runner/lib/LoaderRunner.js:370:3
    at iterateNormalLoaders (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/loader-runner/lib/LoaderRunner.js:211:10)
    at Array.<anonymous> (/Users/Tophe/projects/rust/rust-wasm-experiments/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
 @ ./crate/pkg/ball_wasm.js 2:0-39 42:71-82 43:45-56 55:34-69 62:73-84 63:47-58 77:15-37 96:8-31 102:8-28 213:16-38 303:4-24 322:15-36 329:15-36 338:15-36 345:15-36 354:15-41 361:15-41 385:19-32 394:15-29 407:15-51 418:16-44 429:15-45 442:15-58 451:15-31 457:4-34 473:19-42 490:15-39 511:15-39 520:15-38 533:15-41 549:19-48 568:12-42 574:12-32 595:15-68 605:8-34 611:8-28
 @ ./js/index.js

ERROR in chunk 0
258426ffd4ef125a122b.module.wasm
/Users/Tophe/projects/rust/rust-wasm-experiments/crate/pkg/ball_wasm_bg.wasm
unexpected end

According to their changelog, this is when wasm-bindgen adopted the walrus crate to perform its transformations of the wasm that rustc/LLVM emits - see rustwasm/wasm-bindgen#1237

For the moment, I can make it work by using wasm-bindgen@0.2.34

I checked, you don't have the same error in your examples, do you have any insights about this ?

Tophe

topheman added a commit to topheman/rust-wasm-experiments that referenced this issue May 30, 2019
@fitzgen
Copy link
Contributor

fitzgen commented Jun 3, 2019

Can you make sure that your webpack and dependencies are all on their latest versions? I believe this should be fixed in newer releases.

topheman added a commit to topheman/rust-wasm-experiments that referenced this issue Jun 3, 2019
@topheman
Copy link
Author

topheman commented Jun 3, 2019

Thanks @fitzgen it now works with the latest webpack version.

@topheman topheman closed this as completed Jun 3, 2019
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