Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments at the end of script tags cause errors #64

Closed
mrkishi opened this issue Nov 30, 2016 · 1 comment
Closed

Comments at the end of script tags cause errors #64

mrkishi opened this issue Nov 30, 2016 · 1 comment
Labels

Comments

@mrkishi
Copy link
Member

mrkishi commented Nov 30, 2016

It seems the parser has problems when the last thing in a script tag is a comment, raising the following errors:

SyntaxError: Error transforming $file with 'svelte' plugin: Unterminated regular expression (9:2)

See this gist for an example. Delete the bottom comments to fix the compilation error. It doesn't work with multiline comments either!

Adding anything below the comments also fixes the problem (for instance, uncommenting the last line).

Rich-Harris added a commit that referenced this issue Nov 30, 2016
handle trailing comments in script tags
@Rich-Harris
Copy link
Member

Released 1.0.3 with the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants