Skip to content

Commit 84df8ad

Browse files
ztannergnoff
authored andcommitted
test fixes
1 parent 1a2ce1f commit 84df8ad

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/next/src/client/app-index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ import { HMR_ACTIONS_SENT_TO_BROWSER } from '../server/dev/hot-reloader-types'
1919
// Since React doesn't call onerror for errors caught in error boundaries.
2020
const origConsoleError = window.console.error
2121
window.console.error = (...args) => {
22-
if (isNextRouterError(args[0])) {
22+
// in dev, the actual error is the second argument.
23+
const error = process.env.NODE_ENV === 'development' ? args[1] : args[0]
24+
25+
if (isNextRouterError(error)) {
2326
return
2427
}
2528
origConsoleError.apply(window.console, args)

test/development/acceptance-app/hydration-error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ describe('Error overlay for hydration errors', () => {
570570

571571
const warning = await session.getRedboxDescriptionWarning()
572572
expect(warning).toContain(
573-
'In HTML, <script> cannot be a child of <html>.\nThis will cause a hydration error.'
573+
`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.`
574574
)
575575

576576
await cleanup()

0 commit comments

Comments
 (0)