Skip to content

Successful webpack compilation with typescript error (Vue3 + typescript) #1903

@realkit

Description

@realkit

Version

16.8.3

Reproduction link

github.com

Steps to reproduce

  1. Clone the repo
  2. npm install && npm run build

What is expected?

Something like

ERROR in *****\src\App.vue.ts
    TS2339: Property 'split' does not exist on type 'number'.
webpack 5.64.4 compiled with 1 error

What is actually happening?

webpack 5.64.4 compiled successfully

If run dev-server (npm run start), it will successfully compiled again, but now if change src\App.vue (for example, add new line somewhere it can be added), recompilation will be failed with expected error. But typescript error points to a wrong line (it might be an issue too).

ERROR in ****\src\App.vue.ts
13:15-20
[tsl] ERROR in ****\src\App.vue.ts(13,16) // <---- here seems like consider code in script tag only, not whole App.vue file
      TS2339: Property 'split' does not exist on type 'number'.

webpack 5.64.4 compiled with 1 error

Although, similar project with vue2 and vue-loader 15.9.8 works as expected.

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