Skip to content

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

@pranay-91

Description

@pranay-91

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 ()

@ ./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 ()

@ ./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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions