vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Error after updating to typescript 4.7.X: False expression: Non-string value passed to `ts.resolveTypeReferenceDirective` #7330

Open wal0x opened 2 years ago

wal0x commented 2 years ago

Version

4.5.19

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 106.0.5249.119
    Edge: Spartan (44.19041.1266.0), Chromium (107.0.1418.42)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.4.0
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.1.1
    @vue/babel-plugin-transform-vue-jsx:  1.4.0
    @vue/babel-preset-app:  4.5.19
    @vue/babel-preset-jsx:  1.4.0
    @vue/babel-sugar-composition-api-inject-h:  1.4.0
    @vue/babel-sugar-composition-api-render-instance:  1.4.0
    @vue/babel-sugar-functional-vue:  1.4.0
    @vue/babel-sugar-inject-h:  1.4.0
    @vue/babel-sugar-v-model:  1.4.0
    @vue/babel-sugar-v-on:  1.4.0
    @vue/cli-overlay:  4.5.19
    @vue/cli-plugin-babel: ~4.5.19 => 4.5.19
    @vue/cli-plugin-eslint: ~4.5.19 => 4.5.19
    @vue/cli-plugin-router:  4.5.19
    @vue/cli-plugin-typescript: ~4.5.19 => 4.5.19
    @vue/cli-plugin-unit-mocha: ~4.5.19 => 4.5.19
    @vue/cli-plugin-vuex: ~4.5.19 => 4.5.19
    @vue/cli-service: ~4.5.19 => 4.5.19
    @vue/cli-shared-utils:  4.5.19
    @vue/component-compiler-utils:  3.3.0
    @vue/composition-api: ^1.7.1 => 1.7.1
    @vue/devtools-api:  6.4.5
    @vue/eslint-config-prettier: ~6.0.0 => 6.0.0
    @vue/eslint-config-typescript: ~11.0.2 => 11.0.2
    @vue/preload-webpack-plugin:  1.1.2
    @vue/test-utils: ~1.3.3 => 1.3.3
    @vue/web-component-wrapper:  1.3.0
    eslint-plugin-vue: ~9.7.0 => 9.7.0
    typescript: 4.7.4 => 4.7.4
    vue: ~2.6.14 => 2.6.14
    vue-class-component: ~7.2.6 => 7.2.6
    vue-demi:  0.13.11
    vue-eslint-parser:  9.1.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.10.1 (16.8.3)
    vue-property-decorator: ~9.1.2 => 9.1.2
    vue-style-loader:  4.1.3
    vue-template-compiler: ~2.6.14 => 2.6.14
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

npm run serve

What is expected?

No errors while serving the client

What is actually happening?

INTERNAL ERROR(undefined,undefined) Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature.
 This is probably not a problem in TS itself.
stack trace:
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    at Object.resolveTypeReferenceDirective (C:\repos\myClient\node_modules\typescript\lib\typescript.js:42537:18)
    at resolveTypeReferenceDirective (C:\repos\myClient\node_modules\fork-ts-checker-webpack-plugin\lib\resolution.js:20:35)
    at C:\repos\myClient\node_modules\fork-ts-checker-webpack-plugin\lib\VueProgram.js:81:24
    at Array.map (<anonymous>)
    at Object.host.resolveTypeReferenceDirectives (C:\repos\myClient\node_modules\fork-ts-checker-webpack-plugin\lib\VueProgram.js:80:39)
    at actualResolveTypeReferenceDirectiveNamesWorker (C:\repos\myClient\node_modules\typescript\lib\typescript.js:116674:163)
    at resolveTypeReferenceDirectiveNamesWorker (C:\repos\myClient\node_modules\typescript\lib\typescript.js:116974:26)
    at processTypeReferenceDirectives (C:\repos\myClient\node_modules\typescript\lib\typescript.js:118456:31)
    at findSourceFileWorker (C:\repos\myClient\node_modules\typescript\lib\typescript.js:118341:21)
    at findSourceFile (C:\repos\myClient\node_modules\typescript\lib\typescript.js:118196:26)
Version: typescript 4.7.4
Time: 1780ms

In my Vue 2 project I updated typescript from 4.6 to 4.7. Serving my app throw this error in the console.

wal0x commented 2 years ago

As the error suggests it maybe caused by the very old version 3.1.1 of fork-ts-checker-webpack-plugin

guzuro commented 1 year ago

As the error suggests it maybe caused by the very old version 3.1.1 of fork-ts-checker-webpack-plugin

Hello wal0x! Did you manage to solve the problem with the update to 4.7? Same problem with fork-ts-checker-webpack-plugin

wal0x commented 1 year ago

As the error suggests it maybe caused by the very old version 3.1.1 of fork-ts-checker-webpack-plugin

Hello wal0x! Did you manage to solve the problem with the update to 4.7? Same problem with fork-ts-checker-webpack-plugin

No i couldn't. But updating to webpack 5 solved the issue. I know it's not a solution and not everyone can do this update :/