serverless-side-rendering-vue-nuxt icon indicating copy to clipboard operation
serverless-side-rendering-vue-nuxt copied to clipboard

Upgrade to nuxt2

Open pi0 opened this issue 6 years ago • 4 comments

Hi. Thanks for this clean repo. Here is the summary of changes:

  • Update to [email protected]
  • Use nuxt-start dependency for deployment which is 8.6M install size comparing to nuxt (71.8M)
  • No need to wrap SSR renderer to express
  • Await for nuxt.ready() which is essential for nuxt2
  • Don't prefix publicPath. Assets are fully hashed so no conflict should happen between deployments. It also makes this example simpler.

pi0 avatar May 13 '19 19:05 pi0

@pi0 wouldn't still be nice to use express server to serve the static files like js that has already been generated during npm run build. And to control the headers etc with something like helmetjs?

And any reason you disable gzip compression?

bsthomsen avatar Jul 06 '19 20:07 bsthomsen

  • Using custom server is going to be discouraged soon. Express has unnecessary overhead and headers are still configurable using nuxt config / middleware
  • For gzip it would be better that reverse proxy layer handle it for faster SSR and less cost

pi0 avatar Jul 06 '19 21:07 pi0

@pi0 cool, getting some strange error though disabling the gzip compression. One of the bundled files keeps giving 502. And besides this it doesn't output errors to the cloudwatch logs, is it because nuxt-start in production chokes all the errors?

bsthomsen avatar Jul 09 '19 11:07 bsthomsen

@bsthomsen there is no logging difference between nuxt and nuxt-start (just no builder dependencies). Would you please try adding this to entry point? That may help to debug the issue.

  process.on('unhandledRejection', (err) => {
    console.error(err)
  })

pi0 avatar Jul 11 '19 12:07 pi0