tidev / liveview

Titanium LiveTi (live preview of Titanium applications on device)
Other
7 stars 3 forks source link

next/vite branch: invalid JS syntax when using slashes inside backticks #217

Closed macCesar closed 1 year ago

macCesar commented 1 year ago

I'm getting invalid JS syntax with code like this:

code += `\n</Alloy>`

If I change the backticks ( ` ) to single/double quotes OR remove the slash ( / ).. the error goes away!

// NO syntax error
code += '\n</Alloy>'
code += "\n</Alloy>"

code += `\n<Alloy>` <-- slash removed ( not an option because it is need it )

Of course I can change it to use single/double quotes, but what about when using backticks, variables and closing tags?

code += `\n${spacing}</${element}>`
janvennemann commented 1 year ago

That's actually one of the issues i'm working on right now with the upgrade to Vite 4. There is a custom Vite plugin that will scan source code for dynamic requires and it can't handle a few things properly, like template literals.

janvennemann commented 1 year ago

This should now be fixed in the latest alpha release.