🖥

Nuxt - npm run dev – RpcIpcMessagePortClosedError: Cannot send the me

2023/09/01に公開

原因

調べるとwebpackの暗号化方式かなにかのせいらしい。

NODE_OPTIONS=--openssl-legacy-provider 環境変数を指定することで強制的に古い暗号化方式を使うことができるようだ。
webpackがバージョンアップして良い感じにしてくれるまで(?)これを付けておくととりあえず動きそう。

解決

package.json

{
  "name": "nuxt-project2",
  "version": "1.0.0",
  "private": true,
  "scripts": {
 -   "dev": "nuxt",
+    "dev": "NODE_OPTIONS=--openssl-legacy-provider nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
...

エラー

$ npm run dev
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 37967.
    at /Users/yumainaura/projects/YumaInaura/nuxt-project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: undefined,
  signal: undefined
}

Node.js v18.12.0
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 37966.
    at /Users/yumainaura/projects/YumaInaura/nuxt-project/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: undefined,
  signal: undefined
}

Node.js v18.12.0

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2022-12-29

Discussion