question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New project with Vue 3 and typescript not working - SyntaxError: Unexpected token u in JSON at position 0

See original GitHub issue

Version

4.5.4

Environment info

macos 10.14.4
node 14.5

Steps to reproduce

Create a new project with Vue version 3, typescript option

What is expected?

Build to work when npm run serve

What is actually happening?

Build failed.


@ ./src/App.vue?vue&type=template&id=7ba5bd90 1:0-379 1:0-379 @ ./src/App.vue @ ./src/main.ts @ multi (webpack)-dev-server/client?http://192.168.0.149:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

error in ./src/views/About.vue?vue&type=template&id=039c5b43

Syntax Error: SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>)

@ ./src/views/About.vue?vue&type=template&id=039c5b43 1:0-396 1:0-396 @ ./src/views/About.vue @ ./src/router/index.ts @ ./src/main.ts @ multi (webpack)-dev-server/client?http://192.168.0.149:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

error in ./src/views/Home.vue?vue&type=template&id=fae5bece

Syntax Error: SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>)

@ ./src/views/Home.vue?vue&type=template&id=fae5bece 1:0-395 1:0-395 @ ./src/views/Home.vue @ ./src/router/index.ts @ ./src/main.ts @ multi (webpack)-dev-server/client?http://192.168.0.149:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
sodateacommented, Oct 13, 2020

Update the dependencies.

1reaction
sodateacommented, Oct 27, 2020

In a TS project? I’m gonna release a patch later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token u in JSON at position 0 - Stack Overflow
Try this in the console: JSON.parse(undefined). Here is what you will get: Uncaught SyntaxError: Unexpected token u in JSON at position 0 at ......
Read more >
Troubleshoot 'Uncaught SyntaxError: Unexpected token u in ...
The 'Uncaught SyntaxError: Unexpected token u in JSON at position 0' error is caused when the client has been asked to execute JSON.parse() ......
Read more >
How To Fix Unexpected token u in JSON at position 0 - Isotropic
This error is caused when you are attempting to parse a non-existent property. Typically, this is due to a misspelling, or simply referencing ......
Read more >
Unexpected token u in JSON at position 0 Error in JS
The "Unexpected token u in JSON at position 0" error occurs when we pass an undefined value to the JSON.parse or $.parseJSON methods....
Read more >
How to Fix SyntaxError: Unexpected token < in JSON at ...
To fix this error you need to figure out why you're getting HTML (or something else) instead of the JSON you expected. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found