question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Telemetry needs to be disabled without voodoo

See original GitHub issue

Bug report

We do not want to have telemetry enabled when performing a next build inside a docker container in our build pipeline. It seems like the npx command described in the documentation does not work here. Also its very opaque what that command actually does and where the information that no telemetry is desired is actually stored.

It should be possible to disable telemetry by passing a flag to npm run build instead of executing a npx command beforehand.

Describe the bug

Inside our dockerfile, we try to disable telemetry, then performing the build:

...
# We do not want to be tracked
RUN npx next telemetry disable

# Building app
RUN npm run build
...

According to our pipeline logs, telemetry seems to be re-enabled when the actual build is performed:

Step 13/25 : RUN npx next telemetry disable
 ---> Running in 3cee707075fa
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

Your preference has been saved.

Status: Disabled

You have opted-out of Next.js' anonymous telemetry program.
No data will be collected from your machine.
Learn more: https://nextjs.org/telemetry

Removing intermediate container 3cee707075fa
 ---> f765f98e92b1
Step 14/25 : RUN npm run build
 ---> Running in 0c0c4f9963b2

> stroeer-finance@1.0.0 build /app
> cross-env NODE_ICU_DATA=node_modules/full-icu next build

Creating an optimized production build...
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

To Reproduce

Try disabling telemetry and then build inside a docker container.

Expected behavior

I expected telemetry to be disabled.

System information

  • Docker with node:12-alpine
  • Gitlab CI
  • nextJS 6.13.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
Janpotcommented, Feb 27, 2020

According to the doc:

You may also opt-out by setting an environment variable: NEXT_TELEMETRY_DISABLED=1.

Personally I’d prefer there to be a property in next.config.js.

5reactions
kolpavcommented, Jan 26, 2021

@Timer I want to be able to push this option to my repo and never worry about it again. Setting ENVs for every build stage or running special commands post every clean install is kind of nuts and I can’t help to think it was done intentionally this way. Are you/vercel actively going to fight against making it part of next.config.js so we know if we should bother with PR. Its not so far fetched to think it would need to be approved somewhere higher on your corporate ladder as it would make opting out a little bit too easy and more importantly permanent that would surely bring some of your internal metrics down which is always touchy subject.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telemetry needs to be disabled without voodoo #10713 - GitHub
Try disabling telemetry and then build inside a docker container. Expected behavior. I expected telemetry to be disabled. System information.
Read more >
How to Disable Telemetry on Windows 10 and 11 - MakeUseOf
Once you double-click, a window should pop up. By default, it's set to Not Configured. Select Disabled instead and click OK. changing the...
Read more >
Solved: How to disable EMauSubmissionService in MSI instal...
Solved: Hi, We are trying to install Sourcetree at an enterprise client - they do not want to allow Sourcetree to log installation...
Read more >
No telemetry on TX - IntoFPV Forum
In betaflight reciever page RSSI-channel is disabled and telemtry is set at ON in the configuration page. 2. I get QL-warning in betaflight...
Read more >
How to disconnect the tracking telemetry on the 5th gen ...
How can I disable the telemetry on my 2021 4Runner, I know it's using the Verizon network to connect and report the vehicle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found