0
votes

We have a vue.js application, using nuxt.js, which is pulling data from a Strapi CMS instance hosted on Heroku. The site has a number of relationships that need to be resolved when being built, and this runs well in a local/dev environment with no problems.

However, when we push to Netlify, the page generation process takes a long time, and eventually gives us an error on many pages (although not all):

ERROR   /path/to/page
Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)

in addition, we also receive the following errors in some instances:

Error: socket hang up
    at connResetException (internal/errors.js:604:14)
    at TLSSocket.socketOnEnd (_http_client.js:460:23)
    at TLSSocket.emit (events.js:323:22)
    at TLSSocket.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1204:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

We also receive the same errors when trying to generate the site locally.

We've tried amending the nuxt config to reduce the number of concurrent routes being generated, but this doesn't help.

We're assuming this is a bottleneck with either the build on Netlify, or with Heroku, but as it works locally, perhaps there may be some configuration options we're not aware of.

Any pointers gratefully received.

1

1 Answers

0
votes

I had the same problem before I added the following snippet in my nuxt.config.js under build:

  build: {
    html: { minify: { collapseBooleanAttributes: true, decodeEntities: true, minifyCSS: false, minifyJS: false, processConditionalComments: true, removeEmptyAttributes: true, removeRedundantAttributes: true, trimCustomFragments: true, useShortDoctype: true } }
  }

It seems to do the trick and nuxt generates routes/htmls a lot faster now.