-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable nextjs telemetry? #8851
Comments
|
I just now find this page |
Apparently this only disables telemetry on the current machine (by writing config to |
According to https://nextjs.org/telemetry I have the following options to disable telemetry:
Why wouldn't put something like |
This whole telemetry thing is pretty twisted to be honest. For starters: its crazy opaque. You should definitely ask for consent beforehands. Upon the first Second: Its absolutely against all conventions how this needs to be disabled. I never encountered a project that would need a dev to run an npx command which does unknown voodoo on my machine to disable something in my current project. The command does not run when react has not been installed in the current project. Whut?! The recently added ENV var option seems to work for me, but its only mentioned in a single line at the very bottom of a long page trying to sell telemetry to me and then telling me how to use that npx stuff to disable it. The ENV var way should be communicated FIRST, since its project related. The npx way may be communicated afterwards since its a global setting. Also, I agree with nlevchuk - this should definitely go to next.config - otherwise you just spill possible options across several places, some are in the config file, some need to be passed as env vars - thats just confusing. |
Telemetry has been discussed in-depth on the RFC and there is a lot of prior art: #8442 |
@timneutkens I don't see any mention of including a |
Neither the |
Has a feature request been submitted for disabling telemetry via the next config file? I feel this is the most straightforward and sensible solution; preceding comments seem to support this sentiment. I don't mind writing up an RFC if this hasn't been addressed. |
Other than user's
If you want to use patch-package:
with
In my case it creates diff --git a/node_modules/next/dist/telemetry/post-payload.js b/node_modules/next/dist/telemetry/post-payload.js
index 6b3e5d1..fc2e15c 100644
--- a/node_modules/next/dist/telemetry/post-payload.js
+++ b/node_modules/next/dist/telemetry/post-payload.js
@@ -1,4 +1,4 @@
-"use strict";exports.__esModule=true;exports._postPayload=_postPayload;var _asyncRetry=_interopRequireDefault(require("next/dist/compiled/async-retry"));var _nodeFetch=_interopRequireDefault(require("next/dist/compiled/node-fetch"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _postPayload(endpoint,body){return(0,_asyncRetry.default)(()=>(0,_nodeFetch.default)(endpoint,{method:'POST',body:JSON.stringify(body),headers:{'content-type':'application/json'},timeout:5000}).then(res=>{if(!res.ok){const err=new Error(res.statusText);err.response=res;throw err;}}),{minTimeout:500,retries:1,factor:1}).catch(()=>{// We swallow errors when telemetry cannot be sent
+"use strict";exports.__esModule=true;exports._postPayload=function(){};var _asyncRetry=_interopRequireDefault(require("next/dist/compiled/async-retry"));var _nodeFetch=_interopRequireDefault(require("next/dist/compiled/node-fetch"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _postPayload(endpoint,body){return(0,_asyncRetry.default)(()=>(0,_nodeFetch.default)(endpoint,{method:'POST',body:JSON.stringify(body),headers:{'content-type':'application/json'},timeout:5000}).then(res=>{if(!res.ok){const err=new Error(res.statusText);err.response=res;throw err;}}),{minTimeout:500,retries:1,factor:1}).catch(()=>{// We swallow errors when telemetry cannot be sent
})// Ensure promise is voided
.then(()=>{},()=>{});}
//# sourceMappingURL=post-payload.js.map
\ No newline at end of file The patch-package solution only disable sending telemetry. The telemetry itself is still created and stored somewhere in your machine. |
@timneutkens I dunno, but the time frame from RFC to 'merged' in #8442 was literally 7 days. I don't really think any comments were taken into consideration. I didn't know that next.js was sending anything out until I randomly saw these messages in the build logs. This should be more prominent and very likely OPT-IN instead of opt out. |
While I do understand there being a good argument to be made for opt-out-by-default, I strongly feel as though the current procedure of disabling per machine via This should be a boolean in For anyone seeking an actual way to disable telemetry per project, something along these lines is as good as it's going to get for now:
|
This reflects very badly on Vercel. I would be very skeptical about trying their other products. As others mentioned it should be opt-out rather than opt-in. I had to search online for solutions to disable it. And yet, I can only disable this per project? Which ever genius thought about this is shady as f*ck! I will be looking for other solutions. Whats next after "NextJS"? |
in my case I did: (using yarn) package.json
thanks @isaachinman Please reopen this issue |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
How to disable nextjs telemetry ? I dont want it in my apps
The text was updated successfully, but these errors were encountered: