nuxt-electron icon indicating copy to clipboard operation
nuxt-electron copied to clipboard

ERROR [unhandledRejection] write after end

Open xaviergmail opened this issue 11 months ago • 8 comments

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)

xaviergmail avatar Mar 20 '24 21:03 xaviergmail

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

wladyslaw-malejew avatar Mar 21 '24 22:03 wladyslaw-malejew

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

dongnaebi avatar Mar 31 '24 10:03 dongnaebi

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

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

technatelogy avatar Apr 01 '24 16:04 technatelogy

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.

technatelogy avatar Apr 01 '24 16:04 technatelogy

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

BotellaA avatar Apr 17 '24 15:04 BotellaA

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.

caoxiemeihao avatar Apr 18 '24 05:04 caoxiemeihao

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

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

mihaliak avatar May 22 '24 12:05 mihaliak

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 [email protected] 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.

shinGangan avatar Jun 04 '24 06:06 shinGangan