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

v4.9.0 onward invalid character error when using a dollar sign followed by a symbol (e.g. "$#") #466

Closed
evan-sheehan opened this issue Jan 18, 2022 · 0 comments · Fixed by #473
Labels
bug Something isn't working

Comments

@evan-sheehan
Copy link

evan-sheehan commented Jan 18, 2022

Describe the bug
Writing a dollar sign '$' in code followed immediately by certain symbols (in my case I've confirmed it with '#' and '@') throws an invalid character error.

Logs
image

To Reproduce
Try setting a variable to the string "$#" in a Typescript enabled Sveltekit page and attempt to build the project or run dev and navigate to the respective page.
Here is a repo example: https://github.com/evan-sheehan/svelte-preprocess-bug
I used the "npm init svelte@next" command according to Sveltekit documentation and started a project using the demo template with Typescript but no Eslint and no Prettier.

Expected behavior
An error should not be thrown when svelte-preprocess parses '$#' in the context of a string or comment.

Information about your project:

  • Chrome Version 96.0.4664.45 (Official Build) (64-bit)
  • Zorin 16 - Ubuntu 20.04. 3 LTS
  • Svelte-preprocess anything 4.9.0 and after as far as I've tested.
  • Using Sveltekit so Vite and Rollup are used internally.

Seems related to #402 but not exactly the same.

@dummdidumm dummdidumm added the bug Something isn't working label Jan 19, 2022
andr3h3nriqu3s11 added a commit to andr3h3nriqu3s11/svelte-preprocess that referenced this issue Feb 1, 2022
dummdidumm pushed a commit that referenced this issue Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants