Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
72e908d3
Unverified
Commit
72e908d3
authored
Feb 24, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 24, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev-overlay] Disable error feedback in UI if `NEXT_TELEMETRY_DISABLED` is set (#76423)
parent
6e276347
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
define-env-plugin.ts
packages/next/src/build/webpack/plugins/define-env-plugin.ts
+3
-0
error-feedback.tsx
...rs/error-overlay-footer/error-feedback/error-feedback.tsx
+16
-3
No files found.
packages/next/src/build/webpack/plugins/define-env-plugin.ts
View file @
72e908d3
...
@@ -275,6 +275,9 @@ export function getDefineEnv({
...
@@ -275,6 +275,9 @@ export function getDefineEnv({
'process.env.__NEXT_ASSET_PREFIX'
:
config
.
assetPrefix
,
'process.env.__NEXT_ASSET_PREFIX'
:
config
.
assetPrefix
,
'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS'
:
'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS'
:
!!
config
.
experimental
.
authInterrupts
,
!!
config
.
experimental
.
authInterrupts
,
'process.env.__NEXT_TELEMETRY_DISABLED'
:
Boolean
(
process
.
env
.
NEXT_TELEMETRY_DISABLED
),
...(
isNodeOrEdgeCompilation
...(
isNodeOrEdgeCompilation
?
{
?
{
// Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)
// Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)
...
...
packages/next/src/client/components/react-dev-overlay/ui/components/errors/error-overlay-footer/error-feedback/error-feedback.tsx
View file @
72e908d3
...
@@ -11,6 +11,7 @@ export function ErrorFeedback({ errorCode, className }: ErrorFeedbackProps) {
...
@@ -11,6 +11,7 @@ export function ErrorFeedback({ errorCode, className }: ErrorFeedbackProps) {
const
[
votedMap
,
setVotedMap
]
=
useState
<
Record
<
string
,
boolean
>>
({})
const
[
votedMap
,
setVotedMap
]
=
useState
<
Record
<
string
,
boolean
>>
({})
const
voted
=
votedMap
[
errorCode
]
const
voted
=
votedMap
[
errorCode
]
const
hasVoted
=
voted
!==
undefined
const
hasVoted
=
voted
!==
undefined
const
disabled
=
process
.
env
.
__NEXT_TELEMETRY_DISABLED
const
handleFeedback
=
useCallback
(
const
handleFeedback
=
useCallback
(
async
(
wasHelpful
:
boolean
)
=>
{
async
(
wasHelpful
:
boolean
)
=>
{
...
@@ -63,17 +64,29 @@ export function ErrorFeedback({ errorCode, className }: ErrorFeedbackProps) {
...
@@ -63,17 +64,29 @@ export function ErrorFeedback({ errorCode, className }: ErrorFeedbackProps) {
</
a
>
</
a
>
</
p
>
</
p
>
<
button
<
button
aria
-
disabled=
{
disabled
?
'true'
:
undefined
}
aria
-
label=
"Mark as helpful"
aria
-
label=
"Mark as helpful"
onClick=
{
()
=>
handleFeedback
(
true
)
}
onClick=
{
disabled
?
undefined
:
()
=>
handleFeedback
(
true
)
}
className=
{
cx
(
'feedback-button'
,
voted
===
true
&&
'voted'
)
}
className=
{
cx
(
'feedback-button'
,
voted
===
true
&&
'voted'
)
}
title=
{
disabled
?
'Feedback disabled due to setting NEXT_TELEMETRY_DISABLED'
:
undefined
}
type=
"button"
type=
"button"
>
>
<
ThumbsUp
aria
-
hidden=
"true"
/>
<
ThumbsUp
aria
-
hidden=
"true"
/>
</
button
>
</
button
>
<
button
<
button
aria
-
disabled=
{
disabled
?
'true'
:
undefined
}
aria
-
label=
"Mark as not helpful"
aria
-
label=
"Mark as not helpful"
onClick=
{
()
=>
handleFeedback
(
false
)
}
onClick=
{
disabled
?
undefined
:
()
=>
handleFeedback
(
false
)
}
className=
{
cx
(
'feedback-button'
,
voted
===
false
&&
'voted'
)
}
className=
{
cx
(
'feedback-button'
,
voted
===
false
&&
'voted'
)
}
title=
{
disabled
?
'Feedback disabled due to setting NEXT_TELEMETRY_DISABLED'
:
undefined
}
type=
"button"
type=
"button"
>
>
<
ThumbsDown
<
ThumbsDown
...
@@ -130,7 +143,7 @@ export const styles = `
...
@@ -130,7 +143,7 @@ export const styles = `
}
}
}
}
.feedback-button
:disabled
{
.feedback-button
[aria-disabled='true']
{
opacity: 0.7;
opacity: 0.7;
cursor: not-allowed;
cursor: not-allowed;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment