Replies: 1 comment
-
This has to do with the implementation in std. The You can import the node JS function for reading environment variables and call it. That should give you the environment variables |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi wasm-bindgen team & community,
I stumbled upon this use case just now:
I have a function in
lib.rs
which iterates over the list of environment variables usingstd::env::vars()
I compile successfully (with
wasm-pack build --target nodejs
)I import the generated wasm module into my Node.js script, everything runs fine except it panics as soon as it reaches the
std::env::vars()
part:To reproduce on your local, you could:
make build
, thenmake std-env-vars
My current setups (in case it helps):
I tried looking up in the Discord channel, the GitHub Issues and Discussions sections, but I wasn't able to find a relevant thread. Could I have overlooked anything? Otherwise, is this "use case" justified? Is there anything worth discussing or anything I could elaborate on / help with?
Thank you in advance for your feedback & insights!
Beta Was this translation helpful? Give feedback.
All reactions