vercel / next-learn

Learn Next.js Starter Code
https://next-learn-dashboard.vercel.sh/
MIT License
3.98k stars 1.95k forks source link

Connection terminated unexpectedly #805

Open eddygreat opened 5 months ago

eddygreat commented 5 months ago

Hello, I keep getting this error, how do I resolve it.

Error: Connection terminated unexpectedly at un.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1258:44) at Object.onceWrapper (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:422:39) at un.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at x.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1210:66) at x.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at WebSocket.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:998:51)
at callListener (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:290:14) at WebSocket.onClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:220:9) at WebSocket.emit (node:events:519:28) at WebSocket.emitClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:260:10) at Receiver.receiverOnFinish (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:1181:20) at Receiver.emit (node:events:519:28) at finish (node:internal/streams/writable:946:10) at node:internal/streams/writable:927:13 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) ⨯ node_modules.pnpm\@neondatabase+serverless@0.7.2\node_modules\@neondatabase\serverless\index.mjs (1244:1) @ un.eval ⨯ uncaughtException: Error: Connection terminated unexpectedly at un.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1258:44) at Object.onceWrapper (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:422:39) at un.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at x.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1210:66) at x.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at WebSocket.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:998:51) at callListener (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:290:14) at WebSocket.onClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:220:9) at WebSocket.emit (node:events:519:28) at WebSocket.emitClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:260:10) at Receiver.receiverOnFinish (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:1181:20) at Receiver.emit (node:events:519:28) at finish (node:internal/streams/writable:946:10) at node:internal/streams/writable:927:13 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 1242 | t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on("sslconnect",function(){ 1243 | n.startup(t.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this.

1244 | _ending?new Error("Connection terminated"):new Error("Connection terminated unex\ | ^ 1245 | pectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this. 1246 | _ending||(this._connecting&&!this._connectionError?this._connectionCallback?this. 1247 | _connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent( ⨯ node_modules.pnpm\@neondatabase+serverless@0.7.2\node_modules\@neondatabase\serverless\index.mjs (1244:1) @ un.eval ⨯ uncaughtException: Error: Connection terminated unexpectedly at un.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1258:44) at Object.onceWrapper (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:422:39) at un.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at x.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:1210:66) at x.emit (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:409:63) at WebSocket.eval (webpack-internal:///(rsc)/./node_modules/.pnpm/@neondatabase+serverless@0.7.2/node_modules/@neondatabase/serverless/index.mjs:998:51) at callListener (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:290:14) at WebSocket.onClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js:220:9) at WebSocket.emit (node:events:519:28) at WebSocket.emitClose (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:260:10) at Receiver.receiverOnFinish (webpack-internal:///(rsc)/./node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js:1181:20) at Receiver.emit (node:events:519:28) at finish (node:internal/streams/writable:946:10) at node:internal/streams/writable:927:13 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 1242 | t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on("sslconnect",function(){ 1243 | n.startup(t.getStartupConf())}),this._attachListeners(n),n.once("end",()=>{let i=this. 1244 | _ending?new Error("Connection terminated"):new Error("Connection terminated unex\ | ^ 1245 | pectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(i),this. 1246 | _ending||(this._connecting&&!this._connectionError?this._connectionCallback?this. 1247 | _connectionCallback(i):this._handleErrorEvent(i):this._connectionError||this._handleErrorEvent(

jrpool commented 4 months ago

I got an error with an initially identical message after waiting a few minutes after the attempt to seed the database. No tables got created.

However, I stopped getting this error when I deleted the entire return statement rather than only the message line:

  return Response.json({
    message:
      'Uncomment this file and remove this line. You can delete this file when you are finished.',
  });
Arturgouveia1970 commented 3 months ago

thank you @jrpool. that solved the issue.

AhmedMeshaal commented 2 months ago

Thank you @jrpool .. you're definitely right