vuejs / vue-cli

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

Upgrade to v5 fails due to fork-ts-checker-webpack-plugin ("RpcIpcMessagePortClosedError") #7086

Open Keavon opened 2 years ago

Keavon commented 2 years ago

Version

5.0.4

Reproduction link

github.com

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
  Binaries:
    Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1266.0), Chromium (99.0.1150.55)
  npmPackages:
    @vue/cli-overlay:  5.0.4
    @vue/cli-plugin-eslint: ^5.0.4 => 5.0.4
    @vue/cli-plugin-router:  5.0.4
    @vue/cli-plugin-typescript: ^5.0.4 => 5.0.4
    @vue/cli-plugin-vuex:  5.0.4
    @vue/cli-service: ^5.0.4 => 5.0.4
    @vue/cli-shared-utils:  5.0.4
    @vue/compiler-core:  3.2.31
    @vue/compiler-dom:  3.2.31
    @vue/compiler-sfc: ^3.2.31 => 3.2.31
    @vue/compiler-ssr:  3.2.31
    @vue/component-compiler-utils:  3.3.0
    @vue/eslint-config-airbnb: ^6.0.0 => 6.0.0
    @vue/eslint-config-typescript: ^10.0.0 => 10.0.0
    @vue/reactivity:  3.2.31
    @vue/reactivity-transform:  3.2.31
    @vue/runtime-core:  3.2.31
    @vue/runtime-dom:  3.2.31
    @vue/server-renderer:  3.2.31
    @vue/shared:  3.2.31
    @vue/web-component-wrapper:  1.3.0
    eslint-plugin-prettier-vue: ^3.1.0 => 3.1.0
    eslint-plugin-vue: ^8.5.0 => 8.5.0
    eslint-plugin-vuejs-accessibility:  1.1.1
    typescript: ^4.6.3 => 4.6.3
    vue: ^3.2.26 => 3.2.31
    vue-eslint-parser:  8.3.0
    vue-hot-reload-api:  2.3.4
    vue-loader: ^17.0.0 => 17.0.0 (15.9.8)
    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

cd frontend && npm install

And unfortunately you'll need to install Rust and wasm-pack in order to compile this repo, sorry about that.

Then npm run serve

What is expected?

Compilation after the Vue CLI v5 upgrade should work.

What is actually happening?

C:\Users\Keavon\Projects\Graphite\frontend>npm run serve

> serve
> vue-cli-service serve || echo 'Graphite project failed to build. Did you remember to `npm install` the dependencies?'

 INFO  Starting development server...
[6%] setup (before compile WasmPackPlugin)
🧐  Checking for wasm-pack...

✅  wasm-pack is installed at C:\Users\Keavon\Projects\Graphite\frontend\node_modules\.bin\wasm-pack.CMD. 

ℹ️  Compiling your crate in development mode...

[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
    Finished dev [optimized + debuginfo] target(s) in 0.09s
[WARN]: :-) origin crate has no README
[INFO]: License key is set in Cargo.toml but no LICENSE file(s) were found; Please add the LICENSE file(s) to your project directory
[INFO]: Installing wasm-bindgen...
[INFO]: Optional field missing from Cargo.toml: 'description'. This is not necessary, but recommended
[INFO]: :-) Done in 0.72s
[INFO]: :-) Your wasm pkg is ready to publish at C:\Users\Keavon\Projects\Graphite\frontend\wasm\pkg.
✅  Your crate has been correctly compiled

 DONE  Compiled successfully in 11709ms                                                                                                                                                                   5:21:28 PM

  App running at:
  - Local:   http://localhost:8080/
  - Network: http://192.168.1.11:8080/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

 WAIT  Compiling...                                                                                                                                                                                       5:21:28 PM

Compiling...
No issues found.
[51%] building (25/14 modules)
C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:2559
            throw e;
            ^

Error: Debug Failure.
    at C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:19608:89
    at String.replace (<anonymous>)
    at formatStringFromArgs (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:19608:21)
    at Object.createCompilerDiagnostic (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:19713:20)        
    at tryReadFile (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:39916:23)
    at Object.getParsedCommandLineOfConfigFile (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:39864:30)
    at parseConfigFile (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:120775:43)
    at reloadConfigFile (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:120766:13)
    at updateProgram (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:120741:21)
    at updateProgramWithWatchStatus (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\typescript\lib\typescript.js:120731:13)
C:\Users\Keavon\Projects\Graphite\frontend\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:19
        closedError = new RpcIpcMessagePortClosedError_1.RpcIpcMessagePortClosedError(code
                      ^

RpcIpcMessagePortClosedError: Process 2796 exited with code "1" [null]
    at C:\Users\Keavon\Projects\Graphite\frontend\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:19:23
    at Generator.next (<anonymous>)
    at C:\Users\Keavon\Projects\Graphite\frontend\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:4:12)
    at ChildProcess.handleExit (C:\Users\Keavon\Projects\Graphite\frontend\node_modules\fork-ts-checker-webpack-plugin\lib\rpc\rpc-ipc\RpcIpcMessagePort.js:18:42)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) {
  code: 1,
  signal: null
}

Sorry if this isn't the ideal place to post this. I realize it might be entirely the fault of @vue/cli-plugin-typescript. An issue has been opened there but isn't making any progress towards resolution. Since it's still blocking me in my Vue project, I'm posting this here also in case it's actually caused by something Vue CLI-specific, or if anyone else has encountered and fixed this.

When upgrading my project to Vue CLI v5, my build fails due to fork-ts-checker-webpack-plugin which is a transitive dependency of @vue/cli-plugin-typescript (that lives in a subfolder of this repository).

To troubleshoot, I have fully deleted my package-lock.json and node_modules folder, reran npm install, and then npm run serve still results in this failure.

Hoping for some suggestions to get un-blocked. I really want to upgrade to Vue CLI 5 but this hasn't been possible yet. Thanks.

AkonXI commented 2 years ago

got similar problem when I use pnpm in monorepo . It broken process after change dependencies workspace's package.json.

TimScheifler commented 2 years ago

Have you been able to fix this? I am running into the same problem and have no idea how to fix this.

Keavon commented 2 years ago

@TimScheifler if I recall correctly, it was fixed with https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/674

noynek commented 1 year ago

Has anyone figured this out? I see @Keavon mentions a fix in fork-ts-checker-webpack-plugin, but I'm not sure what to do with that since it's not a direct dependency I can install. Thanks

Keavon commented 1 year ago

@noynek I think you just need to make sure all your direct dependencies are up to date and it should pull in that fixed version. I don't recall what I did exactly to fix this besides updating versions. If you need to reference my project's package.json, [here it is]()https://github.com/GraphiteEditor/Graphite/blob/master/frontend/package.json.

More info: #7092

noynek commented 1 year ago

Thanks @Keavon. When I run npm ls fork-ts-checker-webpack-plugin I see cli-plugin-typescript@5.0.8 referencing what I think is the backported version. I'm wondering if there could be some package caching that might explain why it builds fine in some environments and not the one that's failing. I'll keep digging. I'm on vue 2.7, but I don't see that being directly related to this error.

image