Skip to content
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

Update React from 6c3b8dbfe to a4939017f #63413

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test fixes
  • Loading branch information
ztanner committed Mar 21, 2024
commit 2dd39e40d339a3bf558e2dc1c888112aea26a9eb
5 changes: 4 additions & 1 deletion packages/next/src/client/app-index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { HMR_ACTIONS_SENT_TO_BROWSER } from '../server/dev/hot-reloader-types'
// Since React doesn't call onerror for errors caught in error boundaries.
const origConsoleError = window.console.error
window.console.error = (...args) => {
if (isNextRouterError(args[0])) {
// in dev, the actual error is the second argument.
const error = process.env.NODE_ENV === 'development' ? args[1] : args[0]

if (isNextRouterError(error)) {
return
}
origConsoleError.apply(window.console, args)
Expand Down
2 changes: 1 addition & 1 deletion test/development/acceptance-app/hydration-error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ describe('Error overlay for hydration errors', () => {

const warning = await session.getRedboxDescriptionWarning()
expect(warning).toContain(
'In HTML, <script> cannot be a child of <html>.\nThis will cause a hydration error.'
`Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.`
)

await cleanup()
Expand Down
Loading