lol
- 6 | div - 7 | ) - 8 | } - : ^ - 9 | + ,-[TEST_DIR/index.js:4:1] + 4 |lol
+ 5 | div + 6 | ) + 7 | } + : ^ \`---- x Unexpected eof - ,-[TEST_DIR/index.js:6:1] - 6 | div - 7 | ) - 8 | } - 9 | + ,-[TEST_DIR/index.js:4:1] + 4 |lol
+ 5 | div + 6 | ) + 7 | } \`---- Caused by: diff --git a/test/development/acceptance/__snapshots__/ReactRefreshLogBox-builtins.test.ts.snap b/test/development/acceptance/__snapshots__/ReactRefreshLogBox-builtins.test.ts.snap index 61b51fea30877..d22b4a1d2f676 100644 --- a/test/development/acceptance/__snapshots__/ReactRefreshLogBox-builtins.test.ts.snap +++ b/test/development/acceptance/__snapshots__/ReactRefreshLogBox-builtins.test.ts.snap @@ -4,22 +4,20 @@ exports[`ReactRefreshLogBox default Module not found (empty import trace) 1`] = "./pages/index.js:1:0 Module not found: Can't resolve 'b' > 1 | import Comp from 'b' - 2 | export default function Oops() { - 3 | return ( - 4 |
+ 2 |
+ 3 | export default function Oops() {
+ 4 | return (
https://nextjs.org/docs/messages/module-not-found"
`;
exports[`ReactRefreshLogBox default Module not found (missing global CSS) 1`] = `
-"./pages/_app.js:2:8
+"./pages/_app.js:1:0
Module not found: Can't resolve './non-existent.css'
- 1 |
-> 2 | import './non-existent.css'
- | ^
- 3 |
- 4 | export default function App({ Component, pageProps }) {
- 5 | return
+> 1 | import './non-existent.css'
+ 2 |
+ 3 | export default function App({ Component, pageProps }) {
+ 4 | return
https://nextjs.org/docs/messages/module-not-found"
`;
@@ -28,9 +26,9 @@ exports[`ReactRefreshLogBox default Module not found 1`] = `
"./index.js:1:0
Module not found: Can't resolve 'b'
> 1 | import Comp from 'b'
- 2 | export default function Oops() {
- 3 | return (
- 4 |
+ 2 |
+ 3 | export default function Oops() {
+ 4 | return (
https://nextjs.org/docs/messages/module-not-found
@@ -39,7 +37,7 @@ Import trace for requested module:
`;
exports[`ReactRefreshLogBox default Node.js builtins 1`] = `
-"./node_modules/my-package/index.js:2:0
+"./node_modules/my-package/index.js:1:0
Module not found: Can't resolve 'dns'
https://nextjs.org/docs/messages/module-not-found
diff --git a/test/development/acceptance/__snapshots__/ReactRefreshLogBox.test.ts.snap b/test/development/acceptance/__snapshots__/ReactRefreshLogBox.test.ts.snap
index 8a0214330075c..f603c73653803 100644
--- a/test/development/acceptance/__snapshots__/ReactRefreshLogBox.test.ts.snap
+++ b/test/development/acceptance/__snapshots__/ReactRefreshLogBox.test.ts.snap
@@ -8,15 +8,14 @@ exports[`ReactRefreshLogBox default boundaries 1`] = `
`;
exports[`ReactRefreshLogBox default conversion to class component (1) 1`] = `
-"Child.js (5:18) @ ClickCount.render
-
- 3 | export default class ClickCount extends Component {
- 4 | render() {
-> 5 | throw new Error()
- | ^
- 6 | }
- 7 | }
- 8 | "
+"Child.js (4:10) @ ClickCount.render
+
+ 2 | export default class ClickCount extends Component {
+ 3 | render() {
+> 4 | throw new Error()
+ | ^
+ 5 | }
+ 6 | }"
`;
exports[`ReactRefreshLogBox default css syntax errors 1`] = `
@@ -48,25 +47,25 @@ exports[`ReactRefreshLogBox default logbox: anchors links in error messages 11`]
exports[`ReactRefreshLogBox default logbox: anchors links in error messages 12`] = `"http://example.com/"`;
exports[`ReactRefreshLogBox default module init error not shown 1`] = `
-"index.js (4:14) @ eval
-
- 2 | // top offset for snapshot
- 3 | import * as React from 'react';
-> 4 | throw new Error('no')
- | ^
- 5 | class ClassDefault extends React.Component {
- 6 | render() {
- 7 | return "
- `)
+ "index.js (7:10) @ eval
+
+ 5 | const increment = useCallback(() => {
+ 6 | setCount(c => c + 1)
+ > 7 | throw new Error('oops')
+ | ^
+ 8 | }, [setCount])
+ 9 | return (
+ 10 | "
+ `)
await session.patch(
'index.js',
@@ -428,12 +428,12 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
"./index.js
Error:
x Expected '}', got ''
- ,-[TEST_DIR/index.js:5:1]
- 5 | i++
- 6 | throw Error('no ' + i)
- 7 | }, 1000)
- 8 | export default function FunctionNamed() {
- : ^
+ ,-[TEST_DIR/index.js:4:1]
+ 4 | i++
+ 5 | throw Error('no ' + i)
+ 6 | }, 1000)
+ 7 | export default function FunctionNamed() {
+ : ^
\`----
Caused by:
@@ -455,12 +455,12 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => {
"./index.js
Error:
x Expected '}', got ''
- ,-[TEST_DIR/index.js:5:1]
- 5 | i++
- 6 | throw Error('no ' + i)
- 7 | }, 1000)
- 8 | export default function FunctionNamed() {
- : ^
+ ,-[TEST_DIR/index.js:4:1]
+ 4 | i++
+ 5 | throw Error('no ' + i)
+ 6 | }, 1000)
+ 7 | export default function FunctionNamed() {
+ : ^
\`----
Caused by:
diff --git a/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts b/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts
index fc90a93527f06..2f3f3b34d5f39 100644
--- a/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts
+++ b/test/development/acceptance/server-component-compiler-errors-in-pages.test.ts
@@ -64,12 +64,11 @@ describe('Error Overlay for server components compiler errors in pages', () => {
You're importing a component that needs next/headers. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components
,-[TEST_DIR/components/Comp.js:1:1]
- 1 |
- 2 | import { cookies } from 'next/headers'
- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 3 |
- 4 | export default function Page() {
- 5 | return
Default Export
;" +"index.js (3:6) @ eval + + 1 | // top offset for snapshot + 2 | import * as React from 'react'; +> 3 | throw new Error('no') + | ^ + 4 | class ClassDefault extends React.Component { + 5 | render() { + 6 | returnDefault Export
;" `; exports[`ReactRefreshLogBox default should strip whitespace correctly with newline 1`] = ` -"index.js (9:34) @ onClick +"index.js (8:26) @ onClick - 7 | - 8 | { -> 9 | throw new Error('idk') + 6 | + 7 | { +> 8 | throw new Error('idk') | ^ - 10 | }}> - 11 | click me - 12 | " + 9 | }}> + 10 | click me + 11 | " `; diff --git a/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap b/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap index 69a69c4eb82fa..373d7f774d7a3 100644 --- a/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap +++ b/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ReactRefreshLogBox default syntax > runtime error 1`] = ` -"index.js (6:16) @ Error +"index.js (5:8) @ Error - 4 | setInterval(() => { - 5 | i++ -> 6 | throw Error('no ' + i) - | ^ - 7 | }, 1000) - 8 | export default function FunctionNamed() { - 9 | return " + 3 | setInterval(() => { + 4 | i++ +> 5 | throw Error('no ' + i) + | ^ + 6 | }, 1000) + 7 | export default function FunctionNamed() { + 8 | return " `; diff --git a/test/development/acceptance/error-recovery.test.ts b/test/development/acceptance/error-recovery.test.ts index 226fdd49884d4..b1f7f78b03bc2 100644 --- a/test/development/acceptance/error-recovery.test.ts +++ b/test/development/acceptance/error-recovery.test.ts @@ -106,16 +106,16 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { expect(await session.hasRedbox(true)).toBe(true) expect(await session.getRedboxSource()).toMatchInlineSnapshot(` - "index.js (8:18) @ eval - - 6 | const increment = useCallback(() => { - 7 | setCount(c => c + 1) - > 8 | throw new Error('oops') - | ^ - 9 | }, [setCount]) - 10 | return ( - 11 |hello world
+ 1 | import { cookies } from 'next/headers' + : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 2 | + 3 | export default function Page() { + 4 | returnhello world
\`---- Import trace for requested module: @@ -110,12 +109,11 @@ describe('Error Overlay for server components compiler errors in pages', () => { You're importing a component that needs server-only. That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/getting-started/react-essentials#server-components ,-[TEST_DIR/components/Comp.js:1:1] - 1 | - 2 | import 'server-only' - : ^^^^^^^^^^^^^^^^^^^^ - 3 | - 4 | export default function Page() { - 5 | return 'hello world' + 1 | import 'server-only' + : ^^^^^^^^^^^^^^^^^^^^ + 2 | + 3 | export default function Page() { + 4 | return 'hello world' \`---- Import trace for requested module: