You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
No exceptions, actions are applied to HTML node as usual
OR
compiler error that prevents usage of nested objects in action definition
Stacktraces
Seems like code causing the error is generated in /src/compiler/compile/render_dom/wrappers/shared/add_actions.ts:35
Information about your Svelte project:
Firefox 84.0.1 x64
Windows 10
Svelte 3.31.0
Node 15.4.0
Snowpack + Rollup
Severity
Somewhat annoying, but not critical. There is a workaround for now, but I think this should be addressed at the compiler level, at least to prevent unexpected runtime crashes.
<script>
let ctx = {// or just use flat objects without extra nesting, obviously'button.behavior': (node) => {console.log(node); }, };
</script>
<buttonuse:ctx.button.behavior>Open </button>
UPD: after some fiddling, using flat objects and avoiding nesting is the best option for now, since different IDEs react differently when workaround above is present. VSCode highlights it as missing property, WebStorm - does not
The text was updated successfully, but these errors were encountered:
Describe the bug
Introduced in #3935 support of methods in
use:obj.action
causes runtime exception if method is nested in multiple objectsLogs
To Reproduce
https://svelte.dev/repl/b9576a0efc17479287e6bba62c1e9e85?version=3.31.0
Expected behavior
No exceptions, actions are applied to HTML node as usual
OR
compiler error that prevents usage of nested objects in action definition
Stacktraces
Seems like code causing the error is generated in
/src/compiler/compile/render_dom/wrappers/shared/add_actions.ts:35
Information about your Svelte project:
Severity
Somewhat annoying, but not critical. There is a workaround for now, but I think this should be addressed at the compiler level, at least to prevent unexpected runtime crashes.
UPD: after some fiddling, using flat objects and avoiding nesting is the best option for now, since different IDEs react differently when workaround above is present. VSCode highlights it as missing property, WebStorm - does not
The text was updated successfully, but these errors were encountered: