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

import.meta causing rust to panic #81

Open
ayonli opened this issue Apr 30, 2024 · 5 comments
Open

import.meta causing rust to panic #81

ayonli opened this issue Apr 30, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ayonli
Copy link

ayonli commented Apr 30, 2024

Accessing the import.meta or import.meta.url property will cause the Rust thread to panic, even in an ES module.

thread '<unnamed>' panicked at /Users/arshia/.cargo/git/checkouts/spiderfire-8e3b631d39aa80f1/2a1b5be/runtime/src/module/loader.rs:121:53
@Arshia001
Copy link
Member

@ayonli thanks for reporting this!

Can you also post the panic message please?

@Arshia001 Arshia001 added the bug Something isn't working label Apr 30, 2024
@ayonli
Copy link
Author

ayonli commented May 1, 2024

@Arshia001 The whole error message I got is this:

thread '<unnamed>' panicked at /Users/arshia/.cargo/git/checkouts/spiderfire-8e3b631d39aa80f1/2a1b5be/runtime/src/module/loader.rs:121:53:
called `Result::unwrap()` on an `Err` value: ()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried to set the environment variable both in the .zshrc file or prepend it before the wasmer command, but none of them displays the backtrace.

@Arshia001
Copy link
Member

That's because you need to set it in the WASIX process. Try:

wasmer run wasmer/winterjs -e RUST_BACKTRACE=1 -- ....args

@ayonli
Copy link
Author

ayonli commented May 1, 2024

@Arshia001 I managed to set the env variable via

wasmer run  wasmer/winterjs --env=RUST_BACKTRACE=full ...args

However, there is no backtrace printed, all I got is:

thread '<unnamed>' panicked at /Users/arshia/.cargo/git/checkouts/spiderfire-8e3b631d39aa80f1/2a1b5be/runtime/src/module/loader.rs:121:53:
called `Result::unwrap()` on an `Err` value: ()
stack backtrace:

The backtrace is somehow lost.

@Arshia001
Copy link
Member

Oh well, we tried!

I'll look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants