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

Error parsing JavaScript expression: Expecting Unicode escape sequence \uXXXX #28699

Closed
Daanieeel opened this issue Aug 25, 2024 · 7 comments
Closed

Comments

@Daanieeel
Copy link

Daanieeel commented Aug 25, 2024

Environment



Reproduction

https://stackblitz.com/edit/github-xogbeb?file=pages%2Findex.vue

Describe the bug

Hello.

When loading the website through localhost:3000/ there is no issue.
However, if I load the side through localhost:3000/design, I get the error message down below.
Strangely enough, if I switch to the /design tab through the nav-bar, no error occurs.

The error seems to be with the with-buttons.vue component.

Things I have tried

  • searching for invisible unicode characters with bash scripts as well as Visual Studio Code's "Render Whitespaces" functionality
  • re-creating the .vue file and pasting the code
  • re-creating the .vue file and typing the code again from scratch

How it works again

  • If I remove the <style scoped></style> tag, everything works again
  • If I remove the with-buttons.vue component from my page, everything works again

This issue seems to be quite similar, but didn't help me to resolve my error.

If any information is missing, let me know and I will provide it.

Thank you in advance

Additional context

Error Message

WARN  [Vue Router warn]: uncaught error during route navigation:


ERROR  [vite-node] [plugin:vite:vue] [SyntaxError] PROJECT_FOLDER/components/carousel/with-buttons.vue:1:1 <br><pre>1  |  &lt;template&gt;
   |   ^
2  |    &lt;div class="carousel-with-buttons"&gt;
3  |      &lt;div ref="carousel" class="showcase__carousel"&gt;</pre><br>

|   ^
2  |    &lt;div class="carousel-with-buttons"&gt;
3  |      &lt;div ref="carousel" class="showcase__carousel"&gt;</pre><br>
at PROJECT_FOLDER/components/carousel/with-buttons.vue:1:1
SyntaxError: Error parsing JavaScript expression: Expecting Unicode escape sequence \uXXXX. (2:39)
at createCompilerError (node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1328:17)
at Object.processExpression (node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:4364:9)
at ssrCodegenTransform (node_modules\@vue\compiler-ssr\dist\compiler-ssr.cjs.js:924:33)
at Object.compile (node_modules\@vue\compiler-ssr\dist\compiler-ssr.cjs.js:1390:3)
at doCompileTemplate (node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:4286:47)
at Object.compileTemplate (node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:4228:12)
at compile (/PROJECT_FOLDER/node_modules/@vitejs/plugin-vue/dist/index.mjs:204:35)
at transformTemplateInMain (/PROJECT_FOLDER/node_modules/@vitejs/plugin-vue/dist/index.mjs:185:18)
at genTemplateCode (/PROJECT_FOLDER/node_modules/@vitejs/plugin-vue/dist/index.mjs:2557:12)
at transformMain (/PROJECT_FOLDER/node_modules/@vitejs/plugin-vue/dist/index.mjs:2411:55)

Logs

No response

@huang-julien
Copy link
Member

Hey 👋 thanks for the issue !

Without a minimal reproduction, we won't be able to know what's wrong. Would you be able to scope the issue ?
I'm not sure but the devtools inspect tab can probably show you which transformation plugin failed.

Copy link
Contributor

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

@Daanieeel
Copy link
Author

Here is the reproduction: https://stackblitz.com/edit/github-xogbeb?file=pages%2Findex.vue
I have updated my initial message as well

Copy link

stackblitz bot commented Aug 25, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@Daanieeel
Copy link
Author

When will "needs reproduction" be removed?

@huang-julien
Copy link
Member

Curious... i do get the bug but don't see any issue within the inspector

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants