Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextjs plugin trying to get /_next/webpack-hmr and has no current response #720

Open
2 tasks done
officefish opened this issue Mar 30, 2023 · 1 comment
Open
2 tasks done

Comments

@officefish
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.14.1

Plugin version

9.2.0

Node.js version

18.14

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

11.3

Description

Wnen first running application have a problem:

_{"level":30,"time":1680179132786,"pid":13960,"hostname":"techies","reqId":"req-1","res":{"statusCode":404},"responseTime":1114.3266999721527,"msg":"request completed"}
[App] error - uncaughtException: Error: write ECONNABORTED
[App] at afterWriteDispatched (node:internal/stream_base_commons:160:15)
[App] at writeGeneric (node:internal/stream_base_commons:151:3)
[App] at Socket._writeGeneric (node:net:930:11)
[App] at Socket._write (node:net:942:8)
[App] at writeOrBuffer (node:internal/streams/writable:392:12)
[App] at _write (node:internal/streams/writable:333:10)
[App] at Socket.Writable.write (node:internal/streams/writable:337:10)
[App] at ServerResponse._writeRaw (node:_http_outgoing:428:17)
[App] at ServerResponse._send (node:_http_outgoing:377:15)
[App] at ServerResponse.end (node:http_outgoing:1019:10)
[App] at Gzip.onStreamEnd (D:\practice\fullstack\techies\server\node_modules\next\dist\compiled\compression\index.js:22:1913)
[App] at Gzip.emit (node:events:513:28)
[App] at Gzip.emit (node:domain:489:12)
[App] at endReadableNT (node:internal/streams/readable:1359:12)
[App] at processTicksAndRejections (node:internal/process/task_queues:82:21) {
[App] errno: -4079,
[App] code: 'ECONNABORTED',
[App] syscall: 'write'
[App] }

Steps to Reproduce

I tried to fix it with handle request in plugin register, but something seems wrong with this config:

server.register(fastifyNext, { 
        dev: true,
        noServeAssets: true
     })
    .after(() => {
        server.next(`/_next/*`, async (app:NextServer, req:FastifyRequest, reply:FastifyReply) => {

          app.getRequestHandler()(req.raw, reply.raw).then(() => {
            reply.hijack()
          })
        })
})

Expected Behavior

No response

@officefish officefish changed the title nextjs plugin triing to get /_next/webpack-hmr and has no current response nextjs plugin trying to get /_next/webpack-hmr and has no current response Mar 30, 2023
@Songkeys
Copy link

Songkeys commented Aug 4, 2023

It looks like a problem on Next.js side vercel/next.js#50461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants