Skip to content

Commit

Permalink
Ignore Webpack warnings for defensive require('react-dom/server.edge')
Browse files Browse the repository at this point in the history
Previously failed `NEXT_TEST_MODE=dev NEXT_TEST_REACT_VERSION="18.3.1" p test test/e2e/app-dir/app-edge/app-edge.test.ts`
  • Loading branch information
eps1lon committed Sep 24, 2024
1 parent 5f2edd0 commit c31004a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,14 @@ export default async function getBaseWebpackConfig(
)
),
].filter(Boolean as any as ExcludesFalse),
ignoreWarnings: [
(warning) => {
// require('react-dom/server.edge') is wrapped in try-catch so save to ignore.
return warning.message.startsWith(
'Module not found: Error: Package path ./server.edge is not exported from package'
)
},
],
}

// Support tsconfig and jsconfig baseUrl
Expand Down

0 comments on commit c31004a

Please sign in to comment.