Skip to content

Conversation

ISibboI
Copy link

@ISibboI ISibboI commented Apr 8, 2025

As of now, the "outside reactive tracking context" warning often only points to internals of reactive_graph, making it hard to figure out where in the user code this was caused. This commit adds a backtrace that is printed after the warning. It has the caveat that it is a WASM backtrace, and hence contains less information than a Rust backtrace. However, it is currently impossible to get a nice Rust backtrace out of WASM, hence this seems to be the best option.

As of now, the "outside reactive tracking context" warning often only
points to internals of `reactive_graph`, making it hard to figure out
where in the user code this was caused. This commit adds a backtrace
that is printed after the warning. It has the caveat that it is a WASM
backtrace, and hence contains less information than a Rust backtrace.
However, [it is currently impossible to get a nice Rust backtrace out of
WASM](https://users.rust-lang.org/t/what-is-the-current-state-of-backtraces-in-wasm/128002/2?u=isibboi),
hence this seems to be the best option.
@ISibboI ISibboI changed the title More information in "outside reactive tracking context" warning. More information in "outside reactive tracking context" warning Apr 8, 2025
@rakshith-ravi
Copy link
Collaborator

Does this require the --keep-debug flag on wasm-bindgen (as mentioned in the link)? If so, we'll need to update cargo-leptos to do that. Also, could you please help us with a screenshot of the backtrace? This seems pretty useful. Might be worth including in the changelog.

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

Successfully merging this pull request may close these issues.

2 participants