fastify / fastify-nextjs

React server side rendering support for Fastify with Next
Other
527 stars 61 forks source link

fix: undefined app.server for next 13.4 #751

Closed alexandrucancescu closed 1 year ago

alexandrucancescu commented 1 year ago

fastify-nextjs is not working for next@13.4 because it breaks when trying to access

const basePath = app.server.nextConfig.basePath || ''

with Cannot read properties of undefined (reading 'nextConfig')

To recreate this issue, update next to the latest version and run the tests, all fail with this error.

NextServer provides the getServer() method which returns a promise that returns the server. I changed it to use this function instead of app.server and fortunately this is also compatible with 13.0.0, the version the tests were previously running on.

Tests are now passing with 13.0 and 13.4

Checklist

Uzlopak commented 1 year ago

It seems that nextjs is not supporting node 14 anymore. Can you check that please?

mcollina commented 1 year ago

@Uzlopak PTAL?

Songkeys commented 1 year ago

Hi, when will this cut a new release? 👀

Eomm commented 1 year ago

Done