Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"@next/third-parties": "workspace:*",
"@opentelemetry/api": "1.4.1",
"@picocss/pico": "1.5.10",
"@rspack/core": "1.6.0",
"@rspack/core": "1.6.5",
"@slack/web-api": "7.9.1",
"@swc/cli": "0.1.55",
"@swc/core": "1.11.24",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"types": "index.d.ts",
"dependencies": {
"@next/rspack-core": "1.0.1"
"@next/rspack-core": "npm:@next-rspack/core@1.0.1-beta.3"
}
}
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"@next/swc": "16.1.0-canary.14",
"@opentelemetry/api": "1.6.0",
"@playwright/test": "1.51.1",
"@rspack/core": "1.6.0",
"@rspack/core": "1.6.5",
"@storybook/addon-a11y": "8.6.0",
"@storybook/addon-essentials": "8.6.0",
"@storybook/addon-interactions": "8.6.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/compiled/sass-loader/cjs.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions packages/next/src/shared/lib/format-webpack-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ function formatMessage(
body = body.slice(0, breakingChangeIndex)
}

// TODO: Rspack currently doesn't populate moduleName correctly in some cases,
// fall back to moduleIdentifier as a workaround
if (!message.moduleName && !message.file) {
const parts = message.moduleIdentifier.split('!')
message.moduleName = parts[parts.length - 1]
}

message =
(message.moduleName ? stripAnsi(message.moduleName) + '\n' : '') +
(message.file ? stripAnsi(message.file) + '\n' : '') +
Expand Down
343 changes: 171 additions & 172 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rspack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"change-npm-name": "node ./change-npm-name.js"
},
"dependencies": {
"@rspack/core": "1.6.0",
"@rspack/core": "1.6.5",
"@next/rspack-binding": "workspace:*"
}
}
17 changes: 7 additions & 10 deletions test/development/acceptance-app/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`}\`?
│ ,-[7:1]
│ 4 | <p>lol</p>
Expand Down Expand Up @@ -495,11 +494,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × SyntaxError",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.module.css
× Module build failed:
╰─▶ × SyntaxError
│ (1:1) <FIXME-project-root>/index.module.css Unknown word
Expand Down Expand Up @@ -559,11 +557,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × CssSyntaxError",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.module.css
× Module build failed:
╰─▶ × CssSyntaxError
│ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id)
Expand Down Expand Up @@ -1062,11 +1059,11 @@ describe('ReactRefreshLogBox app', () => {
"description": "test",
"environmentLabel": null,
"label": "Runtime Error",
"source": "index.js (3:11) @ default
"source": "index.js (3:11) @ __rspack_default_export
> 3 | throw new Error('test')
| ^",
"stack": [
"default index.js (3:11)",
"__rspack_default_export index.js (3:11)",
"Page app/page.js (4:10)",
],
}
Expand Down Expand Up @@ -1504,12 +1501,12 @@ describe('ReactRefreshLogBox app', () => {
}
`)
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " ╰─▶ × Error: RspackResolver(NotFound("./boom.css"))",
"environmentLabel": null,
"label": "Build Error",
"source": "× Module build failed:
"source": "<FIXME-project-root>/node_modules/.pnpm/next@file+..+next-repo-9c6e97679f5c3553d3ec04ec28ac7e5aca39fe6dbd50a0b00e66ae89d134f775+packa_kefuxcpyzen6dvrrroklci3grq/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[15].oneOf[10].use[2]!<FIXME-project-root>/node_modules/.pnpm/next@file+..+next-repo-9c6e97679f5c3553d3ec04ec28ac7e5aca39fe6dbd50a0b00e66ae89d134f775+packa_kefuxcpyzen6dvrrroklci3grq/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[15].oneOf[10].use[3]!<FIXME-project-root>/app/styles2.css
╰─▶ × Error: RspackResolver(NotFound("./boom.css"))",
"stack": [],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ describe('ReactRefreshLogBox app', () => {
} else if (isRspack) {
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,
"label": "Build Error",
"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
│ |
Expand Down
24 changes: 8 additions & 16 deletions test/development/acceptance-app/error-recovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '>', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '>', got '<eof>'
│ ,----
│ 1 | export default () => <div/
Expand Down Expand Up @@ -150,11 +149,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./app/server/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[2:1]
│ 1 | export default function Page() {
Expand Down Expand Up @@ -235,11 +233,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./app/client/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[2:1]
│ 1 | export default function Page() {
Expand Down Expand Up @@ -671,11 +668,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[10:1]
│ 7 | throw Error('no ' + i)
Expand Down Expand Up @@ -732,11 +728,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[10:1]
│ 7 | throw Error('no ' + i)
Expand Down Expand Up @@ -925,11 +920,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '{', got 'return'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'return'
│ ,-[5:1]
│ 2 |
Expand Down Expand Up @@ -1009,11 +1003,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '{', got 'throw'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'throw'
│ ,-[5:1]
│ 2 |
Expand Down Expand Up @@ -1136,11 +1129,10 @@ describe('Error recovery app', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./app/page.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,----
│ 1 | {{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expression expected",
"environmentLabel": null,
"label": "Build Error",
"source": "./pages/_app.js
× Module build failed:
╰─▶ × Error: x Expression expected
│ ,-[2:1]
│ 1 | function MyApp({ Component, pageProps }) {
Expand Down Expand Up @@ -239,11 +238,10 @@ describe('ReactRefreshLogBox _app _document', () => {
} else if (isRspack) {
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,
"label": "Build Error",
"source": "./pages/_document.js
× Module build failed:
╰─▶ × Error: x Unexpected token \`{\`. Expected identifier, string literal, numeric literal or [ for the computed key
│ ,-[3:1]
│ 1 | import Document, { Html, Head, Main, NextScript } from 'next/document'
Expand Down
9 changes: 3 additions & 6 deletions test/development/acceptance/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Unexpected token. Did you mean \`{'}'}\` or \`&rbrace;\`?
│ ,-[7:1]
│ 4 | <p>lol</p>
Expand Down Expand Up @@ -709,11 +708,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × SyntaxError",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.module.css
× Module build failed:
╰─▶ × SyntaxError
│ (1:1) <FIXME-project-root>/index.module.css Unknown word
Expand Down Expand Up @@ -771,11 +769,10 @@ describe('ReactRefreshLogBox', () => {
} else if (isRspack) {
await expect(browser).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × CssSyntaxError",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.module.css
× Module build failed:
╰─▶ × CssSyntaxError
│ (1:1) Selector "button" is not pure (pure selectors must contain at least one local class or id)
Expand Down
4 changes: 2 additions & 2 deletions test/development/acceptance/ReactRefreshRegression.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ describe('ReactRefreshRegression', () => {
"description": "boom",
"environmentLabel": null,
"label": "Runtime Error",
"source": "pages/index.js (1:36) @ default
"source": "pages/index.js (1:36) @ __rspack_default_export
> 1 | export default function () { throw new Error('boom'); }
| ^",
"stack": [
"default pages/index.js (1:36)",
"__rspack_default_export pages/index.js (1:36)",
],
}
`)
Expand Down
15 changes: 5 additions & 10 deletions test/development/acceptance/error-recovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '>', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '>', got '<eof>'
│ ,----
│ 1 | export default () => <div/
Expand Down Expand Up @@ -403,11 +402,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '{', got 'return'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'return'
│ ,-[5:1]
│ 2 |
Expand Down Expand Up @@ -488,11 +486,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '{', got 'throw'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '{', got 'throw'
│ ,-[5:1]
│ 2 |
Expand Down Expand Up @@ -823,11 +820,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[7:1]
│ 4 | i++
Expand Down Expand Up @@ -889,11 +885,10 @@ describe('pages/ error recovery', () => {
} else if (isRspack) {
await expect({ browser, next }).toDisplayRedbox(`
{
"description": " × Module build failed:",
"description": " ╰─▶ × Error: x Expected '}', got '<eof>'",
"environmentLabel": null,
"label": "Build Error",
"source": "./index.js
× Module build failed:
╰─▶ × Error: x Expected '}', got '<eof>'
│ ,-[7:1]
│ 4 | i++
Expand Down
Loading
Loading