-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
HTML comment causes misaligned sourcemap #3906
Comments
Seems like anu svelte file where the script tag is not on the first line the sourcemap is off. |
Confirmed. Anything (even a blank line) goes before the script tag will cause the sourcemap line number to be incorrect. |
I have this issue if I put a <style> tag at the top of the component. I've fixed by moving the <style> to the end, but it's obviously a bit odd. |
This should be fixed now in 3.22.0. |
In our project we should add license headers to source files, but when I did that in our first
.svelte
file, I experienced the generated sourcemap is incorrect and it ignores the comments.It makes the debugging more difficult and the test coverage result is useless as well.
Svelte version:
3.14.0
Example
.svelte
source:When I want to debug
test
variable it points to the 2. line of the.svelte
file.This tool can help to visualize source map: http://evanw.github.io/source-map-visualization/
If I add the comment into the script tag, it works without any problem, but it looks stupid.
The text was updated successfully, but these errors were encountered: