caoxiemeihao / nuxt-electron

Integrate Nuxt and Electron
MIT License
169 stars 18 forks source link

ERROR [unhandledRejection] write after end #71

Open xaviergmail opened 3 months ago

xaviergmail commented 3 months ago

This package was working great until I ran nuxi upgrade. I'm getting the error I believe this may be related to: https://github.com/nuxt/nuxt/issues/23832

I tried the nitro proxy workaround described in that thread with no luck. I'll keep playing around and report back with anything I find


 ERROR  [unhandledRejection] write after end                                                   1:58:54 PM

  at _write (node:internal/streams/writable:481:11)
  at Writable.write (node:internal/streams/writable:502:10)
  at Sender.sendFrame (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:58524:20)
  at Sender.close (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:58252:12)
  at WebSocket.close (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:59332:18)
  at Receiver.receiverOnConclude (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:60178:18)
  at Receiver.emit (node:events:518:28)
  at Receiver.controlMessage (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:57982:14)
  at Receiver.getData (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:57798:12)
  at Receiver.startLoop (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:57488:16)
  at Receiver._write (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:57415:10)
  at writeOrBuffer (node:internal/streams/writable:564:12)
  at _write (node:internal/streams/writable:493:10)
  at Writable.write (node:internal/streams/writable:502:10)
  at Socket.socketOnData (node_modules/vite/dist/node/chunks/dep-B-u6xNiR.js:60327:37)
  at Socket.emit (node:events:518:28)
  at addChunk (node:internal/streams/readable:559:12)
  at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
  at Readable.push (node:internal/streams/readable:390:5)
  at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
wladyslaw-malejew commented 3 months ago

having the same. even quick-start example project is not starting

dongnaebi commented 3 months ago

The first attempt to use nuxt-electron was entangled by this issue. Is there any workaround?

technatelogy commented 3 months ago

Pretty sure this is caused by this: nuxt/nuxt#26396

It doesn't seem to actually be fixed...

technatelogy commented 3 months ago

This bug doesn't exist in the older version of nuxt/nuxi (I'm not sure which). You can get around this issue for now by requiring an older version. For me I was previously using nuxt: 3.10.2 and nuxi: 3.10.1.

You'll have to add an overrides (npm) or resolutions (yarn) section to your package.json to force it to install the older version of nuxi but then things should actually work.

BotellaA commented 2 months ago

Nuxt core team seems not ready to solve this issue. Does someone have an idea of a fix or work around?

caoxiemeihao commented 2 months ago

This bug doesn't exist in the older version of nuxt/nuxi (I'm not sure which). You can get around this issue for now by > requiring an older version. For me I was previously using nuxt: 3.10.2 and nuxi: 3.10.1.

I downgraded nuxt to 3.6.5 and everything works fine, and you can try using the latest quick-start.

mihaliak commented 1 month ago

https://github.com/caoxiemeihao/nuxt-electron/issues/74#issuecomment-2117567168

Fixed it for me, but it should be definitely handled in package itself

shinGangan commented 3 weeks ago

Hey everyone and @caoxiemeihao , This problem is resolved?

I tested it with the following pattern and an error occurred in versions v3.11.0 and later.

// package.json

  "scripts": {
-   "dev": "nuxt dev",
+   "dev": "npx nuxi@3.x.y dev",
  }
version OK / NG
v3.10.0 ⭕️
v3.10.1 ⭕️
v3.11.0 ⭕️
v3.11.1(nuxt/cli is latest ) NG: "write after end" error occurs

I'm currently using v3.11.0. I hope this experiment will lead to a solution hint.