mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
update @next/rspack-core version to 1.0.2 and update the snapshot other changes: - packages/next/src/build/webpack-config.ts Adjusted configuration to account for differences in default node config between Rspack and Webpack. - packages/next/src/shared/lib/format-webpack-messages.ts Added a fallback to moduleIdentifier in cases where Rspack does not correctly populate moduleName.
29 lines
806 B
TypeScript
29 lines
806 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
import stripAnsi from 'strip-ansi'
|
|
|
|
describe('build-error-logs', () => {
|
|
const { next, isTurbopack, isRspack } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should only log error a single time', async () => {
|
|
await next.fetch('/')
|
|
const output = stripAnsi(next.cliOutput)
|
|
|
|
expect(output).toContain('Module not found')
|
|
|
|
const moduleNotFoundLogs = output
|
|
.split('\n')
|
|
.filter((line) => line.includes('Module not found'))
|
|
|
|
if (isTurbopack) {
|
|
expect(moduleNotFoundLogs).toHaveLength(1)
|
|
} else if (isRspack) {
|
|
expect([2, 3]).toContain(moduleNotFoundLogs.length)
|
|
} else {
|
|
// FIXME: next with webpack still logs the same error too many times
|
|
expect(moduleNotFoundLogs).toHaveLength(3)
|
|
}
|
|
})
|
|
})
|