Unverified Commit affb52da authored by Cong-Cong Pan's avatar Cong-Cong Pan Committed by GitHub

chore: update rspack 1.6.5 (#86853)

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.
parent 1427bf87
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
"@next/third-parties": "workspace:*", "@next/third-parties": "workspace:*",
"@opentelemetry/api": "1.4.1", "@opentelemetry/api": "1.4.1",
"@picocss/pico": "1.5.10", "@picocss/pico": "1.5.10",
"@rspack/core": "1.6.0", "@rspack/core": "1.6.7",
"@slack/web-api": "7.9.1", "@slack/web-api": "7.9.1",
"@swc/cli": "0.1.55", "@swc/cli": "0.1.55",
"@swc/core": "1.11.24", "@swc/core": "1.11.24",
......
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
}, },
"types": "index.d.ts", "types": "index.d.ts",
"dependencies": { "dependencies": {
"@next/rspack-core": "1.0.1" "@next/rspack-core": "1.0.2"
} }
} }
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
"@next/swc": "16.1.0-canary.30", "@next/swc": "16.1.0-canary.30",
"@opentelemetry/api": "1.6.0", "@opentelemetry/api": "1.6.0",
"@playwright/test": "1.51.1", "@playwright/test": "1.51.1",
"@rspack/core": "1.6.0", "@rspack/core": "1.6.7",
"@storybook/addon-a11y": "8.6.0", "@storybook/addon-a11y": "8.6.0",
"@storybook/addon-essentials": "8.6.0", "@storybook/addon-essentials": "8.6.0",
"@storybook/addon-interactions": "8.6.0", "@storybook/addon-interactions": "8.6.0",
......
...@@ -2263,6 +2263,15 @@ export default async function getBaseWebpackConfig( ...@@ -2263,6 +2263,15 @@ export default async function getBaseWebpackConfig(
if (isRspack) { if (isRspack) {
// The layers experiment is now stable in Rspack // The layers experiment is now stable in Rspack
delete webpack5Config.experiments!.layers delete webpack5Config.experiments!.layers
if (!webpack5Config.node) {
webpack5Config.node = {}
}
// NOTE: Rspack's defaults differ from webpack.
if (isClient || isEdgeServer) {
webpack5Config.node.__dirname = 'mock'
webpack5Config.node.__filename = 'mock'
}
} }
webpack5Config.module!.parser = { webpack5Config.module!.parser = {
......
...@@ -59,6 +59,18 @@ function formatMessage( ...@@ -59,6 +59,18 @@ function formatMessage(
body = body.slice(0, breakingChangeIndex) body = body.slice(0, breakingChangeIndex)
} }
// TODO: Rspack currently doesn't populate moduleName correctly in some cases,
// fall back to moduleIdentifier as a workaround
if (
process.env.NEXT_RSPACK &&
!message.moduleName &&
!message.file &&
message.moduleIdentifier
) {
const parts = message.moduleIdentifier.split('!')
message.moduleName = parts[parts.length - 1]
}
message = message =
(message.moduleName ? stripAnsi(message.moduleName) + '\n' : '') + (message.moduleName ? stripAnsi(message.moduleName) + '\n' : '') +
(message.file ? stripAnsi(message.file) + '\n' : '') + (message.file ? stripAnsi(message.file) + '\n' : '') +
......
This diff is collapsed.
...@@ -294,11 +294,10 @@ describe('ReactRefreshLogBox app', () => { ...@@ -294,11 +294,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`? ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
│ ,-[7:1] │ ,-[7:1]
│ 4 | <p>lol</p> │ 4 | <p>lol</p>
...@@ -495,11 +494,10 @@ describe('ReactRefreshLogBox app', () => { ...@@ -495,11 +494,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × SyntaxError",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css "source": "./index.module.css
× Module build failed:
╰─▶ × SyntaxError ╰─▶ × SyntaxError
│ │
│ (1:1) <FIXME-project-root>/index.module.css Unknown word │ (1:1) <FIXME-project-root>/index.module.css Unknown word
...@@ -559,11 +557,10 @@ describe('ReactRefreshLogBox app', () => { ...@@ -559,11 +557,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × CssSyntaxError",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css "source": "./index.module.css
× Module build failed:
╰─▶ × CssSyntaxError ╰─▶ × CssSyntaxError
│ │
│ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id) │ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id)
...@@ -1056,6 +1053,21 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1056,6 +1053,21 @@ describe('ReactRefreshLogBox app', () => {
], ],
} }
`) `)
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": "test",
"environmentLabel": null,
"label": "Runtime Error",
"source": "index.js (3:11) @ __rspack_default_export
> 3 | throw new Error('test')
| ^",
"stack": [
"__rspack_default_export index.js (3:11)",
"Page app/page.js (4:10)",
],
}
`)
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
...@@ -1504,13 +1516,12 @@ describe('ReactRefreshLogBox app', () => { ...@@ -1504,13 +1516,12 @@ describe('ReactRefreshLogBox app', () => {
} }
`) `)
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " ╰─▶ × Error: RspackResolver(NotFound("./boom.css"))", "description": "Failed to compile",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "× Module build failed: "source": "╰─▶ × Error: RspackResolver(NotFound("./boom.css"))",
╰─▶ × Error: RspackResolver(NotFound("./boom.css"))",
"stack": [], "stack": [],
} }
`) `)
......
...@@ -47,11 +47,10 @@ describe('ReactRefreshLogBox app', () => { ...@@ -47,11 +47,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/page.js "source": "./app/page.js
× Module build failed:
╰─▶ × Error: x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching ╰─▶ × Error: x "getStaticProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
│ | │ |
│ │
......
...@@ -56,11 +56,10 @@ describe('Error recovery app', () => { ...@@ -56,11 +56,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '>', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '>', got '<eof>' ╰─▶ × Error: x Expected '>', got '<eof>'
│ ,---- │ ,----
│ 1 | export default () => <div/ │ 1 | export default () => <div/
...@@ -150,11 +149,10 @@ describe('Error recovery app', () => { ...@@ -150,11 +149,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/server/page.js "source": "./app/server/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[2:1] │ ,-[2:1]
│ 1 | export default function Page() { │ 1 | export default function Page() {
...@@ -235,11 +233,10 @@ describe('Error recovery app', () => { ...@@ -235,11 +233,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/client/page.js "source": "./app/client/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[2:1] │ ,-[2:1]
│ 1 | export default function Page() { │ 1 | export default function Page() {
...@@ -671,11 +668,10 @@ describe('Error recovery app', () => { ...@@ -671,11 +668,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[10:1] │ ,-[10:1]
│ 7 | throw Error('no ' + i) │ 7 | throw Error('no ' + i)
...@@ -732,11 +728,10 @@ describe('Error recovery app', () => { ...@@ -732,11 +728,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[10:1] │ ,-[10:1]
│ 7 | throw Error('no ' + i) │ 7 | throw Error('no ' + i)
...@@ -925,11 +920,10 @@ describe('Error recovery app', () => { ...@@ -925,11 +920,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got 'return'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'return' ╰─▶ × Error: x Expected '{', got 'return'
│ ,-[5:1] │ ,-[5:1]
│ 2 | │ 2 |
...@@ -1009,11 +1003,10 @@ describe('Error recovery app', () => { ...@@ -1009,11 +1003,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got 'throw'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'throw' ╰─▶ × Error: x Expected '{', got 'throw'
│ ,-[5:1] │ ,-[5:1]
│ 2 | │ 2 |
...@@ -1136,11 +1129,10 @@ describe('Error recovery app', () => { ...@@ -1136,11 +1129,10 @@ describe('Error recovery app', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/page.js "source": "./app/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,---- │ ,----
│ 1 | {{{ │ 1 | {{{
......
...@@ -119,11 +119,10 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -119,11 +119,10 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expression expected",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./pages/_app.js "source": "./pages/_app.js
× Module build failed:
╰─▶ × Error: x Expression expected ╰─▶ × Error: x Expression expected
│ ,-[2:1] │ ,-[2:1]
│ 1 | function MyApp({ Component, pageProps }) { │ 1 | function MyApp({ Component, pageProps }) {
...@@ -239,11 +238,10 @@ describe('ReactRefreshLogBox _app _document', () => { ...@@ -239,11 +238,10 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./pages/_document.js "source": "./pages/_document.js
× Module build failed:
╰─▶ × Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key ╰─▶ × Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key
│ ,-[3:1] │ ,-[3:1]
│ 1 | import Document, { Html, Head, Main, NextScript } from 'next/document' │ 1 | import Document, { Html, Head, Main, NextScript } from 'next/document'
......
...@@ -455,11 +455,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -455,11 +455,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`? ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
│ ,-[7:1] │ ,-[7:1]
│ 4 | <p>lol</p> │ 4 | <p>lol</p>
...@@ -709,11 +708,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -709,11 +708,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × SyntaxError",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css "source": "./index.module.css
× Module build failed:
╰─▶ × SyntaxError ╰─▶ × SyntaxError
│ │
│ (1:1) <FIXME-project-root>/index.module.css Unknown word │ (1:1) <FIXME-project-root>/index.module.css Unknown word
...@@ -771,11 +769,10 @@ describe('ReactRefreshLogBox', () => { ...@@ -771,11 +769,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × CssSyntaxError",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.module.css "source": "./index.module.css
× Module build failed:
╰─▶ × CssSyntaxError ╰─▶ × CssSyntaxError
│ │
│ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id) │ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id)
......
...@@ -6,7 +6,7 @@ import { outdent } from 'outdent' ...@@ -6,7 +6,7 @@ import { outdent } from 'outdent'
import path from 'path' import path from 'path'
describe('ReactRefreshRegression', () => { describe('ReactRefreshRegression', () => {
const { isTurbopack, next } = nextTestSetup({ const { isTurbopack, isRspack, next } = nextTestSetup({
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
skipStart: true, skipStart: true,
dependencies: { dependencies: {
...@@ -295,6 +295,20 @@ describe('ReactRefreshRegression', () => { ...@@ -295,6 +295,20 @@ describe('ReactRefreshRegression', () => {
], ],
} }
`) `)
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": "boom",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/index.js (1:36) @ __rspack_default_export
> 1 | export default function () { throw new Error('boom'); }
| ^",
"stack": [
"__rspack_default_export pages/index.js (1:36)",
],
}
`)
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
......
...@@ -58,11 +58,10 @@ describe('pages/ error recovery', () => { ...@@ -58,11 +58,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '>', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '>', got '<eof>' ╰─▶ × Error: x Expected '>', got '<eof>'
│ ,---- │ ,----
│ 1 | export default () => <div/ │ 1 | export default () => <div/
...@@ -403,11 +402,10 @@ describe('pages/ error recovery', () => { ...@@ -403,11 +402,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got 'return'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'return' ╰─▶ × Error: x Expected '{', got 'return'
│ ,-[5:1] │ ,-[5:1]
│ 2 | │ 2 |
...@@ -488,11 +486,10 @@ describe('pages/ error recovery', () => { ...@@ -488,11 +486,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got 'throw'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'throw' ╰─▶ × Error: x Expected '{', got 'throw'
│ ,-[5:1] │ ,-[5:1]
│ 2 | │ 2 |
...@@ -823,11 +820,10 @@ describe('pages/ error recovery', () => { ...@@ -823,11 +820,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[7:1] │ ,-[7:1]
│ 4 | i++ │ 4 | i++
...@@ -889,11 +885,10 @@ describe('pages/ error recovery', () => { ...@@ -889,11 +885,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) { } else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(` await expect({ browser, next }).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./index.js "source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>' ╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[7:1] │ ,-[7:1]
│ 4 | i++ │ 4 | i++
......
...@@ -81,7 +81,6 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -81,7 +81,6 @@ describe('Error Overlay for server components compiler errors in pages', () => {
) )
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
"./components/Comp.js "./components/Comp.js
× Module build failed:
╰─▶ × Error: x 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/app/building-your-application/rendering/server-components ╰─▶ × Error: x 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/app/building-your-application/rendering/server-components
│ | │ |
│ │
...@@ -165,7 +164,6 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -165,7 +164,6 @@ describe('Error Overlay for server components compiler errors in pages', () => {
) )
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
"./components/Comp.js "./components/Comp.js
× Module build failed:
╰─▶ × Error: x 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/app/building-your-application/rendering/server-components ╰─▶ × Error: x 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/app/building-your-application/rendering/server-components
│ | │ |
│ │
...@@ -251,7 +249,6 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -251,7 +249,6 @@ describe('Error Overlay for server components compiler errors in pages', () => {
) )
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
"./components/Comp.js "./components/Comp.js
× Module build failed:
╰─▶ × Error: x You're importing a component that needs "after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components ╰─▶ × Error: x You're importing a component that needs "after". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
│ | │ |
│ │
...@@ -346,7 +343,6 @@ describe('Error Overlay for server components compiler errors in pages', () => { ...@@ -346,7 +343,6 @@ describe('Error Overlay for server components compiler errors in pages', () => {
) )
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
"./components/Comp.js "./components/Comp.js
× Module build failed:
╰─▶ × Error: x You're importing a component that needs "next/root-params". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components ╰─▶ × Error: x You're importing a component that needs "next/root-params". That only works in a Server Component which is not supported in the pages/ directory. Read more: https://nextjs.org/docs/app/building-your-application/rendering/server-components
│ | │ |
│ │
......
...@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils'
import stripAnsi from 'strip-ansi' import stripAnsi from 'strip-ansi'
describe('build-error-logs', () => { describe('build-error-logs', () => {
const { next, isTurbopack } = nextTestSetup({ const { next, isTurbopack, isRspack } = nextTestSetup({
files: __dirname, files: __dirname,
}) })
...@@ -18,6 +18,8 @@ describe('build-error-logs', () => { ...@@ -18,6 +18,8 @@ describe('build-error-logs', () => {
if (isTurbopack) { if (isTurbopack) {
expect(moduleNotFoundLogs).toHaveLength(1) expect(moduleNotFoundLogs).toHaveLength(1)
} else if (isRspack) {
expect([2, 3]).toContain(moduleNotFoundLogs.length)
} else { } else {
// FIXME: next with webpack still logs the same error too many times // FIXME: next with webpack still logs the same error too many times
expect(moduleNotFoundLogs).toHaveLength(3) expect(moduleNotFoundLogs).toHaveLength(3)
......
...@@ -151,11 +151,10 @@ describe('Cache Components Dev Errors', () => { ...@@ -151,11 +151,10 @@ describe('Cache Components Dev Errors', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./app/page.tsx "source": "./app/page.tsx
× Module build failed:
╰─▶ × Error: x Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it. ╰─▶ × Error: x Route segment config "revalidate" is not compatible with \`nextConfig.cacheComponents\`. Please remove it.
│ ,-[1:1] │ ,-[1:1]
│ 1 | export const revalidate = 10 │ 1 | export const revalidate = 10
......
...@@ -37,11 +37,10 @@ describe('app-dir - server-component-next-dynamic-ssr-false', () => { ...@@ -37,11 +37,10 @@ describe('app-dir - server-component-next-dynamic-ssr-false', () => {
`) `)
} else if (process.env.NEXT_RSPACK) { } else if (process.env.NEXT_RSPACK) {
expect(redbox.description).toMatchInlineSnapshot( expect(redbox.description).toMatchInlineSnapshot(
`" × Module build failed:"` `" ╰─▶ × Error: x \`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component."`
) )
expect(redbox.source).toMatchInlineSnapshot(` expect(redbox.source).toMatchInlineSnapshot(`
"./app/page.js "./app/page.js
× Module build failed:
╰─▶ × Error: x \`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component. ╰─▶ × Error: x \`ssr: false\` is not allowed with \`next/dynamic\` in Server Components. Please move it into a Client Component.
│ ,-[3:1] │ ,-[3:1]
│ 1 | import dynamic from 'next/dynamic' │ 1 | import dynamic from 'next/dynamic'
......
...@@ -192,11 +192,10 @@ describe('react-dom/server in React Server environment', () => { ...@@ -192,11 +192,10 @@ describe('react-dom/server in React Server environment', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "<FIXME-nextjs-internal-source> "source": "<FIXME-nextjs-internal-source>
× Module build failed:
╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security. ╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.
│ | Learn more: https://nextjs.org/docs/app/building-your-application/rendering │ | Learn more: https://nextjs.org/docs/app/building-your-application/rendering
│ ,-[1:1] │ ,-[1:1]
...@@ -341,9 +340,8 @@ describe('react-dom/server in React Server environment', () => { ...@@ -341,9 +340,8 @@ describe('react-dom/server in React Server environment', () => {
} else if (isRspack) { } else if (isRspack) {
expect(redbox).toMatchInlineSnapshot(` expect(redbox).toMatchInlineSnapshot(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.",
"source": "./app/exports/app-code/react-dom-server-node-implicit/page.js "source": "./app/exports/app-code/react-dom-server-node-implicit/page.js
× Module build failed:
╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security. ╰─▶ × Error: x You're importing a component that imports react-dom/server. To fix it, render or return the content directly as a Server Component instead for perf and security.
│ | Learn more: https://nextjs.org/docs/app/building-your-application/rendering │ | Learn more: https://nextjs.org/docs/app/building-your-application/rendering
│ ,-[1:1] │ ,-[1:1]
......
...@@ -176,7 +176,6 @@ export function runErrorRecoveryHmrTest(nextConfig: { ...@@ -176,7 +176,6 @@ export function runErrorRecoveryHmrTest(nextConfig: {
} else if (process.env.NEXT_RSPACK) { } else if (process.env.NEXT_RSPACK) {
expect(trimEndMultiline(source)).toMatchInlineSnapshot(` expect(trimEndMultiline(source)).toMatchInlineSnapshot(`
"./pages/hmr/about2.js "./pages/hmr/about2.js
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`? ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
│ ,-[7:1] │ ,-[7:1]
│ 4 | <p>This is the about page.</p> │ 4 | <p>This is the about page.</p>
...@@ -538,7 +537,6 @@ export function runErrorRecoveryHmrTest(nextConfig: { ...@@ -538,7 +537,6 @@ export function runErrorRecoveryHmrTest(nextConfig: {
expect(trimEndMultiline(next.normalizeTestDirContent(redboxSource))) expect(trimEndMultiline(next.normalizeTestDirContent(redboxSource)))
.toMatchInlineSnapshot(` .toMatchInlineSnapshot(`
"./components/parse-error.js "./components/parse-error.js
× Module build failed:
╰─▶ × Error: x Expression expected ╰─▶ × Error: x Expression expected
│ ,-[3:1] │ ,-[3:1]
│ 1 | This │ 1 | This
......
...@@ -170,7 +170,6 @@ describe('mcp-server get_errors tool', () => { ...@@ -170,7 +170,6 @@ describe('mcp-server get_errors tool', () => {
\`\`\` \`\`\`
./app/build-error/page.tsx ./app/build-error/page.tsx
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`? ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
│ ,-[4:1] │ ,-[4:1]
│ 1 | export default function BuildErrorPage() { │ 1 | export default function BuildErrorPage() {
......
...@@ -37,6 +37,10 @@ describe('middleware - development errors', () => { ...@@ -37,6 +37,10 @@ describe('middleware - development errors', () => {
// TODO(veil): Sourcemap to original name i.e. "default" // TODO(veil): Sourcemap to original name i.e. "default"
'\n at __TURBOPACK__default__export__ (middleware.js:3:15)' + '\n at __TURBOPACK__default__export__ (middleware.js:3:15)' +
'\n 1 |' '\n 1 |'
: isRspack
? '\n⨯ Error: boom' +
'\n at __rspack_default_export (middleware.js:3:15)' +
'\n 1 |'
: '\n⨯ Error: boom' + : '\n⨯ Error: boom' +
'\n at default (middleware.js:3:15)' + '\n at default (middleware.js:3:15)' +
'\n 1 |' '\n 1 |'
...@@ -71,11 +75,11 @@ describe('middleware - development errors', () => { ...@@ -71,11 +75,11 @@ describe('middleware - development errors', () => {
"description": "boom", "description": "boom",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime Error", "label": "Runtime Error",
"source": "middleware.js (3:15) @ default "source": "middleware.js (3:15) @ __rspack_default_export
> 3 | throw new Error('boom') > 3 | throw new Error('boom')
| ^", | ^",
"stack": [ "stack": [
"default middleware.js (3:15)", "__rspack_default_export middleware.js (3:15)",
], ],
} }
`) `)
...@@ -134,6 +138,11 @@ describe('middleware - development errors', () => { ...@@ -134,6 +138,11 @@ describe('middleware - development errors', () => {
// TODO(veil): Sourcemap to original name i.e. "default" // TODO(veil): Sourcemap to original name i.e. "default"
'\n at __TURBOPACK__default__export__ (middleware.js:7:9)' + '\n at __TURBOPACK__default__export__ (middleware.js:7:9)' +
"\n 2 | import { NextResponse } from 'next/server'" "\n 2 | import { NextResponse } from 'next/server'"
: isRspack
? '\n⨯ unhandledRejection: Error: async boom!' +
'\n at throwError (middleware.js:4:15)' +
'\n at __rspack_default_export (middleware.js:7:9)' +
"\n 2 | import { NextResponse } from 'next/server'"
: '\n⨯ unhandledRejection: Error: async boom!' + : '\n⨯ unhandledRejection: Error: async boom!' +
'\n at throwError (middleware.js:4:15)' + '\n at throwError (middleware.js:4:15)' +
'\n at default (middleware.js:7:9)' + '\n at default (middleware.js:7:9)' +
...@@ -234,12 +243,12 @@ describe('middleware - development errors', () => { ...@@ -234,12 +243,12 @@ describe('middleware - development errors', () => {
"description": "test is not defined", "description": "test is not defined",
"environmentLabel": null, "environmentLabel": null,
"label": "Runtime ReferenceError", "label": "Runtime ReferenceError",
"source": "middleware.js (4:9) @ default "source": "middleware.js (4:9) @ __rspack_default_export
> 4 | eval('test') > 4 | eval('test')
| ^", | ^",
"stack": [ "stack": [
"<FIXME-file-protocol>", "<FIXME-file-protocol>",
"default middleware.js (4:9)", "__rspack_default_export middleware.js (4:9)",
], ],
} }
`) `)
...@@ -297,6 +306,12 @@ describe('middleware - development errors', () => { ...@@ -297,6 +306,12 @@ describe('middleware - development errors', () => {
? '\n⨯ Error: booooom!' + ? '\n⨯ Error: booooom!' +
// TODO(veil): Should be sourcemapped // TODO(veil): Should be sourcemapped
'\n at module evaluation (middleware.js:3:13)' '\n at module evaluation (middleware.js:3:13)'
: isRspack
? '\n⨯ Error: booooom!' +
`\n at <unknown> (${getDistDir()}/server/edge-runtime-webpack.js:35)` +
'\n at eval (middleware.js:3:13)' +
`\n at (middleware)/./middleware.js (${getDistDir()}/server/middleware.js:26:1)` +
'\n at __webpack_require__ '
: '\n⨯ Error: booooom!' + : '\n⨯ Error: booooom!' +
// TODO: Should be anonymous method without a method name // TODO: Should be anonymous method without a method name
'\n at <unknown> (middleware.js:3)' + '\n at <unknown> (middleware.js:3)' +
...@@ -490,11 +505,10 @@ describe('middleware - development errors', () => { ...@@ -490,11 +505,10 @@ describe('middleware - development errors', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got '}'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./middleware.js "source": "./middleware.js
× Module build failed:
╰─▶ × Error: x Expected '{', got '}' ╰─▶ × Error: x Expected '{', got '}'
│ ,---- │ ,----
│ 1 | export default function () } │ 1 | export default function () }
...@@ -576,11 +590,10 @@ describe('middleware - development errors', () => { ...@@ -576,11 +590,10 @@ describe('middleware - development errors', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Expected '{', got '}'",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "./middleware.js "source": "./middleware.js
× Module build failed:
╰─▶ × Error: x Expected '{', got '}' ╰─▶ × Error: x Expected '{', got '}'
│ ,---- │ ,----
│ 1 | export default function () } │ 1 | export default function () }
......
...@@ -244,6 +244,20 @@ describe('Client Navigation rendering', () => { ...@@ -244,6 +244,20 @@ describe('Client Navigation rendering', () => {
], ],
} }
`) `)
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": "This is an expected error",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/error-inside-page.js (2:9) @ __rspack_default_export
> 2 | throw new Error('This is an expected error')
| ^",
"stack": [
"__rspack_default_export pages/error-inside-page.js (2:9)",
],
}
`)
} else { } else {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
......
...@@ -1102,7 +1102,7 @@ describe('Cache Components Errors', () => { ...@@ -1102,7 +1102,7 @@ describe('Cache Components Errors', () => {
], ],
}, },
{ {
"description": "(0 , <webpack-module-id>.cookies)(...).get is not a function", "description": "(0 , next_headers__rspack_import_1.cookies)(...).get is not a function",
"environmentLabel": "Prerender", "environmentLabel": "Prerender",
"label": "Runtime TypeError", "label": "Runtime TypeError",
"source": "app/sync-cookies/page.tsx (18:36) @ CookiesReadingComponent "source": "app/sync-cookies/page.tsx (18:36) @ CookiesReadingComponent
...@@ -1284,7 +1284,7 @@ describe('Cache Components Errors', () => { ...@@ -1284,7 +1284,7 @@ describe('Cache Components Errors', () => {
], ],
}, },
{ {
"description": "(0 , <webpack-module-id>.cookies)(...).get is not a function", "description": "(0 , next_headers__rspack_import_1.cookies)(...).get is not a function",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime TypeError", "label": "Runtime TypeError",
"source": "app/sync-cookies-runtime/page.tsx (24:36) @ CookiesReadingComponent "source": "app/sync-cookies-runtime/page.tsx (24:36) @ CookiesReadingComponent
...@@ -1438,7 +1438,7 @@ describe('Cache Components Errors', () => { ...@@ -1438,7 +1438,7 @@ describe('Cache Components Errors', () => {
], ],
}, },
{ {
"description": "(0 , <webpack-module-id>.headers)(...).get is not a function", "description": "(0 , next_headers__rspack_import_1.headers)(...).get is not a function",
"environmentLabel": "Prerender", "environmentLabel": "Prerender",
"label": "Runtime TypeError", "label": "Runtime TypeError",
"source": "app/sync-headers/page.tsx (18:40) @ HeadersReadingComponent "source": "app/sync-headers/page.tsx (18:40) @ HeadersReadingComponent
...@@ -1620,7 +1620,7 @@ describe('Cache Components Errors', () => { ...@@ -1620,7 +1620,7 @@ describe('Cache Components Errors', () => {
], ],
}, },
{ {
"description": "(0 , <webpack-module-id>.headers)(...).get is not a function", "description": "(0 , next_headers__rspack_import_1.headers)(...).get is not a function",
"environmentLabel": "Server", "environmentLabel": "Server",
"label": "Runtime TypeError", "label": "Runtime TypeError",
"source": "app/sync-headers-runtime/page.tsx (24:40) @ HeadersReadingComponent "source": "app/sync-headers-runtime/page.tsx (24:40) @ HeadersReadingComponent
......
...@@ -40,7 +40,6 @@ describe('app-dir - error-on-next-codemod-comment', () => { ...@@ -40,7 +40,6 @@ describe('app-dir - error-on-next-codemod-comment', () => {
} else if (process.env.NEXT_RSPACK) { } else if (process.env.NEXT_RSPACK) {
expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` expect(await getRedboxSource(browser)).toMatchInlineSnapshot(`
"./app/page.tsx "./app/page.tsx
× Module build failed:
╰─▶ × Error: x You have an unresolved @next/codemod comment "remove jsx of next line" that needs review. ╰─▶ × Error: x You have an unresolved @next/codemod comment "remove jsx of next line" that needs review.
│ | After review, either remove the comment if you made the necessary changes or replace "@next-codemod-error" with "@next-codemod-ignore" to bypass the build error if no action at this line can be taken. │ | After review, either remove the comment if you made the necessary changes or replace "@next-codemod-error" with "@next-codemod-ignore" to bypass the build error if no action at this line can be taken.
│ │
......
...@@ -52,8 +52,7 @@ describe('CSS Import from node_modules', () => { ...@@ -52,8 +52,7 @@ describe('CSS Import from node_modules', () => {
`) `)
} else if (isRspack) { } else if (isRspack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./node_modules/.pnpm/next@file+..+next-repo-9363c99f3d71d8f039ab2f44b0982247ca3f251f6a3cb48f6f97e14bd6290b68_3cf165911481a65b93532bfb8e2c9025/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[8].oneOf[14].use[1]!./node_modules/.pnpm/next@file+..+next-repo-9363c99f3d71d8f039ab2f44b0982247ca3f251f6a3cb48f6f97e14bd6290b68_3cf165911481a65b93532bfb8e2c9025/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[8].oneOf[14].use[2]!./node_modules/.pnpm/next@file+..+next-repo-9363c99f3d71d8f039ab2f44b0982247ca3f251f6a3cb48f6f97e14bd6290b68_3cf165911481a65b93532bfb8e2c9025/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[8].oneOf[14].use[3]!./node_modules/.pnpm/next@file+..+next-repo-9363c99f3d71d8f039ab2f44b0982247ca3f251f6a3cb48f6f97e14bd6290b68_3cf165911481a65b93532bfb8e2c9025/node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[8].oneOf[14].use[4]!./styles/global.scss "./node_modules/.pnpm/next@file+..+next-repo-8fa5cfcca6029b56fbac0f566cc3851341e4c064ae33fb2a225547c1fab39f23+packa_apujtevk23v6mt6lxsvypt6azu/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[9].oneOf[14].use[1]!./node_modules/.pnpm/next@file+..+next-repo-8fa5cfcca6029b56fbac0f566cc3851341e4c064ae33fb2a225547c1fab39f23+packa_apujtevk23v6mt6lxsvypt6azu/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[9].oneOf[14].use[2]!./node_modules/.pnpm/next@file+..+next-repo-8fa5cfcca6029b56fbac0f566cc3851341e4c064ae33fb2a225547c1fab39f23+packa_apujtevk23v6mt6lxsvypt6azu/node_modules/next/dist/build/webpack/loaders/resolve-url-loader/index.js??ruleSet[1].rules[9].oneOf[14].use[3]!./node_modules/.pnpm/next@file+..+next-repo-8fa5cfcca6029b56fbac0f566cc3851341e4c064ae33fb2a225547c1fab39f23+packa_apujtevk23v6mt6lxsvypt6azu/node_modules/next/dist/compiled/sass-loader/cjs.js??ruleSet[1].rules[9].oneOf[14].use[4]!./styles/global.scss
× Module build failed:
╰─▶ × Error: RspackResolver(NotFound("nprogress/nprogress.css"))" ╰─▶ × Error: RspackResolver(NotFound("nprogress/nprogress.css"))"
`) `)
} else { } else {
......
...@@ -35,11 +35,10 @@ describe('use-cache-segment-configs', () => { ...@@ -35,11 +35,10 @@ describe('use-cache-segment-configs', () => {
} else if (isRspack) { } else if (isRspack) {
await expect(browser).toDisplayRedbox(` await expect(browser).toDisplayRedbox(`
{ {
"description": " × Module build failed:", "description": " ╰─▶ × Error: x Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.",
"environmentLabel": null, "environmentLabel": null,
"label": "Build Error", "label": "Build Error",
"source": "<FIXME-nextjs-internal-source> "source": "<FIXME-nextjs-internal-source>
× Module build failed:
╰─▶ × Error: x Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it. ╰─▶ × Error: x Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.
│ ,-[1:1] │ ,-[1:1]
│ 1 | export const runtime = 'edge' │ 1 | export const runtime = 'edge'
...@@ -98,7 +97,6 @@ describe('use-cache-segment-configs', () => { ...@@ -98,7 +97,6 @@ describe('use-cache-segment-configs', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
" "
// TODO(veil): Fix broken import trace for Webpack loader resource. // TODO(veil): Fix broken import trace for Webpack loader resource.
× Module build failed:
╰─▶ × Error: x Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it. ╰─▶ × Error: x Route segment config "runtime" is not compatible with \`nextConfig.experimental.useCache\`. Please remove it.
│ ,-[1:1] │ ,-[1:1]
│ 1 | export const runtime = 'edge' │ 1 | export const runtime = 'edge'
......
...@@ -50,7 +50,6 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -50,7 +50,6 @@ describe('use-cache-unknown-cache-kind', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
" "
./app/page.tsx ./app/page.tsx
× Module build failed:
╰─▶ × Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config. ╰─▶ × Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config.
│ │
│ ,-[1:1] │ ,-[1:1]
...@@ -118,7 +117,7 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -118,7 +117,7 @@ describe('use-cache-unknown-cache-kind', () => {
) )
} else if (isRspack) { } else if (isRspack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
`" × Module build failed:"` `" ╰─▶ × Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config."`
) )
} else { } else {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
...@@ -141,9 +140,8 @@ describe('use-cache-unknown-cache-kind', () => { ...@@ -141,9 +140,8 @@ describe('use-cache-unknown-cache-kind', () => {
} else if (isRspack) { } else if (isRspack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./app/page.tsx "./app/page.tsx
× Module build failed:
╰─▶ × Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config. ╰─▶ × Error: x Unknown cache kind "custom". Please configure a cache handler for this kind in the \`cacheHandlers\` object in your Next.js config.
│ | │
│ ,-[1:1] │ ,-[1:1]
│ 1 | 'use cache: custom' │ 1 | 'use cache: custom'
│ : ^^^^^^^^^^^^^^^^^^^ │ : ^^^^^^^^^^^^^^^^^^^
......
...@@ -53,7 +53,6 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -53,7 +53,6 @@ describe('use-cache-without-experimental-flag', () => {
expect(buildOutput).toMatchInlineSnapshot(` expect(buildOutput).toMatchInlineSnapshot(`
" "
./app/page.tsx ./app/page.tsx
× Module build failed:
╰─▶ × Error: x To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config. ╰─▶ × Error: x To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config.
│ | │ |
│ | Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage │ | Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage
...@@ -114,7 +113,7 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -114,7 +113,7 @@ describe('use-cache-without-experimental-flag', () => {
) )
} else if (isRspack) { } else if (isRspack) {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
`" × Module build failed:"` `" ╰─▶ × Error: x To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config."`
) )
} else { } else {
expect(errorDescription).toMatchInlineSnapshot( expect(errorDescription).toMatchInlineSnapshot(
...@@ -139,7 +138,6 @@ describe('use-cache-without-experimental-flag', () => { ...@@ -139,7 +138,6 @@ describe('use-cache-without-experimental-flag', () => {
} else if (isRspack) { } else if (isRspack) {
expect(errorSource).toMatchInlineSnapshot(` expect(errorSource).toMatchInlineSnapshot(`
"./app/page.tsx "./app/page.tsx
× Module build failed:
╰─▶ × Error: x To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config. ╰─▶ × Error: x To use "use cache", please enable the feature flag \`cacheComponents\` in your Next.js config.
│ | │ |
│ | Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage │ | Read more: https://nextjs.org/docs/canary/app/api-reference/directives/use-cache#usage
......
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