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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error doesn't tell Svelte how to indicate line number #149

Open
canadaduane opened this issue Sep 20, 2020 · 0 comments
Open

Syntax error doesn't tell Svelte how to indicate line number #149

canadaduane opened this issue Sep 20, 2020 · 0 comments

Comments

@canadaduane
Copy link
Contributor

canadaduane commented Sep 20, 2020

馃悰 Bug Report

When I have a syntax error in a svelte file, the error message does not indicate which line to look at.

For example, in the script section of a svelte file, I began a "$:" line, but didn't finish it (leave it dangling, with no statement following the "$:"). This is a syntax error. I received the following error message when compiling:

馃毃  /Users/duane/Projects/relm/src/audiovideo/Conference.svelte: Unexpected token
    at error$1 (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:15595:20)
    at Parser$1.error (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:15671:10)
    at Parser$1.acorn_error (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:15665:15)
    at Object.read_script [as read] (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:7377:17)
    at tag (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:14737:34)
    at new Parser$1 (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:15630:22)
    at parse$3 (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:15761:21)
    at compile (/Users/duane/Projects/relm/node_modules/svelte/compiler.js:26931:18)
    at SvelteAsset.generate (/Users/duane/Projects/relm/node_modules/parcel-plugin-svelte/lib/svelte-asset.js:43:25)

See sveltejs/svelte#5411

馃捇 Code Sample

Leave a dangling $: somewhere inside the <script> section of a .svelte file to generate a syntax error.

馃實 Your Environment

Svelte: 3.23.2

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

No branches or pull requests

1 participant