Skip to content

Vue cli generates project with vue 3.0.5, but with typescript ~3.9.3 #6299

Closed
@ghost

Description

Version

4.5.11

Reproduction link

https://github.com/snwfx/vue-3.0.5_ts-3.x

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
  Binaries:
    Node: 12.18.0 - C:\WS\tools\node-v12.18.0-win-x64\node.EXE
    Yarn: Not Found
    npm: 6.14.4 - C:\WS\tools\node-v12.18.0-win-x64\npm.CMD
  Browsers:
    Chrome: 88.0.4324.182
    Edge: Spartan (44.18362.449.0)
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

From minimal reproduction repo:

  • Run npm install
  • Run npm run build

Project creation steps:

  • Run "vue create"
  • Select "Manually select features"
  • "Choose Vue version" is checked
  • "Babel" is checked
  • "Typescript" is checked
  • "Linter / Formatter" is checked
  • Proceed
  • Select "3.x (Preview)"
  • Use class-style component syntax? => N
  • Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? => Y
  • Select "ESLint with error prevention only"
  • "Lint on save" is checked
  • Proceed
  • Select "In dedicated config files"
  • "Save this as a preset for future projects?" => N

What is expected?

Build is successful. No errors.

What is actually happening?

ERROR Failed to compile with 1 error 3:34:15:34

error in src/App.vue:21:22

TS2345: Argument of type 'object | Ref | ComputedRef | (() => unknown)' is not assignable to parameter of type 'string'.
Type 'object' is not assignable to type 'string'.
19 |
20 | watch([simpleRef1, simpleRef2], ([newString1, newString2]) => {

21 | consumeStrings(newString1, newString2)
| ^^^^^^^^^^
22 | })
23 | }
24 | });

ERROR Build failed with errors.


This error is coming from the fact that project has been generated with vue 3.0.5 and typescript 3, while vue 3.0.5 requires typescript 4.

Note: I'm not looking for how it can be fixed for this project, I'm looking for Vue Cli to generate project with consistent dependencies so it will work out of the box.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions