Unverified Commit c50641f7 authored by Hannes Bornö's avatar Hannes Bornö Committed by GitHub

Remove next-app-loader from import trace (#44996)

parent 27b95ffb
...@@ -86,7 +86,7 @@ export async function getNotFoundError( ...@@ -86,7 +86,7 @@ export async function getNotFoundError(
.filter( .filter(
(name) => (name) =>
name && name &&
!/next-(middleware|client-pages|flight-(client|server|client-entry))-loader\.js/.test( !/next-(app|middleware|client-pages|flight-(client|server|client-entry))-loader\.js/.test(
name name
) )
) )
......
...@@ -1365,5 +1365,35 @@ for (const variant of ['default', 'turbo']) { ...@@ -1365,5 +1365,35 @@ for (const variant of ['default', 'turbo']) {
await cleanup() await cleanup()
}) })
test('Import trace when module not found in layout', async () => {
const { session, cleanup } = await sandbox(
next,
new Map([['app/module.js', `import "non-existing-module"`]])
)
await session.patch(
'app/layout.js',
`
import "./module"
export default function RootLayout({ children }) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}
`
)
expect(await session.hasRedbox(true)).toBe(true)
expect(await session.getRedboxSource()).toMatchSnapshot()
await cleanup()
})
}) })
} }
...@@ -6,6 +6,17 @@ exports[`ReactRefreshLogBox app default Hydration errors should get error link 1 ...@@ -6,6 +6,17 @@ exports[`ReactRefreshLogBox app default Hydration errors should get error link 1
See more info here: https://nextjs.org/docs/messages/react-hydration-error" See more info here: https://nextjs.org/docs/messages/react-hydration-error"
`; `;
exports[`ReactRefreshLogBox app default Import trace when module not found in layout 1`] = `
"./app/module.js:1:0
Module not found: Can't resolve 'non-existing-module'
> 1 | import \\"non-existing-module\\"
Import trace for requested module:
./app/layout.js
https://nextjs.org/docs/messages/module-not-found"
`;
exports[`ReactRefreshLogBox app default Should not show __webpack_exports__ when exporting anonymous arrow function 1`] = ` exports[`ReactRefreshLogBox app default Should not show __webpack_exports__ when exporting anonymous arrow function 1`] = `
"index.js (4:16) @ default "index.js (4:16) @ default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment