Stuck on deploy express / next app to netlify

Viewed 762

I'm stuck to deploy my Next/Express app on Netlify.

The app works fine locally but when I want to build on using Netlify lambda function it doesn't work.

Here my git repos for some test : https://github.com/Lazy974/NextExpress

If I only use next build script, the app can be deployed but I can't use express but if I use the Netlify script netlify-lambda build (src/directory) I get this error:

Can't resolve 'pnpapi' in '.../Express_Next/node_modules/pnp-webpack-plugin'

If I use the basically script server.js (without next configuration) it works but not locally.

1 Answers

Netlify doesn't support a server. So if you want to run Next.JS with a custom express server I would recommend using something like Heroku.

Related