cargo-web
cargo-web copied to clipboard
thread 'main' panicked at 'unknown name section chunk type: 7'
After running cargo web, executing the wasm file results in this panic:
thread 'main' panicked at 'unknown name section chunk type: 7', src/wasm_context.rs:642:41
I fixed this in this commit: https://github.com/Badel2/cargo-web/commit/46b3637af68a2df6a17dffe152d2148180442aca
By replacing the panic with an error. Not sure if this has any consequences, but it seems to work.
If you encounter this problem you can use my fork:
cargo install --git https://github.com/Badel2/cargo-web cargo-web
I've encoutered this problem too... But unfortunately your workaround also didn't work.
I have also encountered this issue any solutions yet?
I have also encountered this issue any solutions yet?
I have also encountered this issue any solutions yet?
anti-similar comment tactic
Same issue with latest 0.6.26 version trying to recompile my project...
I've encountered this issue with rust version > 1.51 <= 1.57. It works for me in 1.47 and 1.51(built successfully, but had runtime errors), not tested any other versions.
this may be related https://github.com/koute/stdweb/issues/411
This is also an issue for me when working on https://github.com/sotrh/gamepads. I have a backtrace:
RUST_BACKTRACE=1 cargo web start > errors.txt
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
warning: unused variable: `id`
--> src/main.rs:37:32
|
37 | while let Some(Event { id, event, time}) = context.next_event() {
| ^^ help: try ignoring the field: `id: _`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `event`
--> src/main.rs:37:36
|
37 | while let Some(Event { id, event, time}) = context.next_event() {
| ^^^^^ help: try ignoring the field: `event: _`
warning: unused variable: `time`
--> src/main.rs:37:43
|
37 | while let Some(Event { id, event, time}) = context.next_event() {
| ^^^^ help: try ignoring the field: `time: _`
warning: 3 warnings emitted
Processing "gamepads.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/wasm_context.rs:642:41
stack backtrace:
0: rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
1: std::panicking::begin_panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:460:5
2: cargo_web::wasm_context::Context::from_module
3: cargo_web::wasm::process_wasm_file
4: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
5: cargo_web::cargo_shim::BuildConfig::build_internal
6: cargo_web::cargo_shim::BuildConfig::build
7: cargo_web::build::Project::build_or_check
8: cargo_web::cmd_start::LastBuild::new
9: cargo_web::cmd_start::command_start
10: cargo_web::run
11: cargo_web::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Same problem here :/
$ RUST_BACKTRACE=1 cargo web build --target=wasm32-unknown-unknown
warning: unused manifest key: cargo-web
warning: unused manifest key: default-target
warning: unused manifest key: prepend-js
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Processing "wasm-test.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', /home/<user>/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-web-0.6.26/src/wasm_context.rs:642:41
stack backtrace:
0: rust_begin_unwind
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
2: cargo_web::wasm_context::Context::from_module
3: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
4: cargo_web::cargo_shim::BuildConfig::build_internal
5: cargo_web::cargo_shim::BuildConfig::build
6: cargo_web::build::Project::build_or_check
7: cargo_web::cmd_build::command_build_or_check
8: cargo_web::run
9: cargo_web::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
I'm using in WSL2, is impossible to build a simple script
Someone can help me?
This issue still remains unsovled...
I'm stuck on this error as well. I don't know what I'm doing. [Doge.jpg] Encountered this while trying to run https://github.com/rustyscreeps/screeps-starter-rust 🤷
It says this... if it helps any:
Processing "screeps-starter-rust.wasm"...
thread 'main' panicked at 'unknown name section chunk type: 7', C:\Users\Andrew\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-web-0.6.26\src\wasm_context.rs:642:41
stack backtrace:
0: 0x7ff7341cb312 - <unknown>
1: 0x7ff7341eee5b - <unknown>
2: 0x7ff7341c2f6a - <unknown>
3: 0x7ff7341cb05b - <unknown>
4: 0x7ff7341cde39 - <unknown>
5: 0x7ff7341cdabb - <unknown>
6: 0x7ff7341ce6d0 - <unknown>
7: 0x7ff7341ce45e - <unknown>
8: 0x7ff7341cc00f - <unknown>
9: 0x7ff7341ce110 - <unknown>
10: 0x7ff73420ed25 - <unknown>
11: 0x7ff733e530b8 - <unknown>
12: 0x7ff733dea8e4 - <unknown>
13: 0x7ff733e35843 - <unknown>
14: 0x7ff733e04deb - <unknown>
15: 0x7ff733e019d5 - <unknown>
16: 0x7ff733e4be7a - <unknown>
17: 0x7ff733e0648f - <unknown>
18: 0x7ff733d301d3 - <unknown>
19: 0x7ff733d03af6 - <unknown>
20: 0x7ff733cf9c76 - <unknown>
21: 0x7ff733cf9eec - <unknown>
22: 0x7ff7341bb8be - <unknown>
23: 0x7ff733d03e4c - <unknown>
24: 0x7ff7341f6ef4 - <unknown>
25: 0x7ff820ef55a0 - BaseThreadInitThunk
26: 0x7ff82246485b - RtlUserThreadStart
I can't believe that a core dependency for many apps is just abandoned completely dead like this. It's sad to see.
Likewise here. Is this project no longer maintained?