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
I integrated twin.macro into my svelte project, and everything works as expected, but after making any change, HMR always errors out with "ReferenceError: tw is not defined".
The parts of the code using tw, in and out of the template, are replaced with a JS object of the corresponding tailwind styles, but HMR (or something else?) is capturing tw as if it's a reactive component variable, as seen in the compiled output:
Yes indeed, $capture_state is too greedy, it shouldn't capture imports. This is something that needs to be fixed in Svelte. I'm going to see if I can do something.
I integrated twin.macro into my svelte project, and everything works as expected, but after making any change, HMR always errors out with "ReferenceError: tw is not defined".
Here's a reproduction repo. Run
yarn dev
, then make any change in the template, and the error will show up.The parts of the code using
tw
, in and out of the template, are replaced with a JS object of the corresponding tailwind styles, but HMR (or something else?) is capturingtw
as if it's a reactive component variable, as seen in the compiled output:I'm not sure what would be the best way around this 🤔 I can provide any additional details as needed
The text was updated successfully, but these errors were encountered: