Fix: nuxt.js app not working on AWS with CI/CD pipeline since nuxt-telemetry release

Since Nuxt.js 2.13+ has been released, there’s a nuxt-telemetry package coming with it. According to the documentation, „Nuxt.js collects anonymous telemetry data about general usage. […] This program is optional. You will be asked on first time to get permission and you can always opt-out if you’d not like to share any information.“

The permission dialogue is what caused me some headache, I guess. As my application runs on AWS, deployed by a CI/CD pipeline, it actually broke. Also, my application firewall doesn’t allow the required connection when running the pipeline.

[error] [@nuxt/telemetry] Error sending sent to `https://telemetry.nuxtjs.com` (26 ms)
request to https://telemetry.nuxtjs.com/ failed, reason: connect ECONNREFUSED 

On AWS CloudWatch, I saw logs stating /home/$user/.nuxtrc cannot be opened. For the time being, I can only guess it has something to do with the telemetry setup not running properly.

In the end, I simply decided to disable nuxt-telemetry, finally causing my application to work again. In nuxt.config, simply add the following part:

export default {
  telemetry: false
}

There’s an issue you can follow on GitHub. You can follow-up on this topic there, in case you’re interested in delivering telemetry data to Nuxt.js in order to help the project improve: https://github.com/nuxt/telemetry/issues/16

Update 21.06.2020

nuxt-telemetry v1.1.0 comes with the following changes:

  • „Better CI detection is implemented with v1.1.0 so prompt will be auto skipped on CI environments“
  • „using nuxt telemetry enable sets consent value“

Sources: https://github.com/nuxt/telemetry/issues/16#issuecomment-647102174 and https://github.com/nuxt/telemetry/releases/tag/v1.1.0