/You're importing a component that needs "?after"?\. That only works in a Server Component but one of its parents is marked with "use client", so it's a Client Component\./
/'after' cannot be imported from a Client Component module/
@@ -192,11 +192,12 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -192,11 +192,12 @@ describe('react-dom/server in React Server environment', () => {
}elseif(isRspack){
}elseif(isRspack){
awaitexpect(browser).toDisplayRedbox(`
awaitexpect(browser).toDisplayRedbox(`
{
{
"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.",
"description": " ╰─▶ × Error: x 'react-dom/server' cannot be imported from a Server Component module.",
"environmentLabel": null,
"environmentLabel": null,
"label": "Build Error",
"label": "Build Error",
"source": "<FIXME-nextjs-internal-source>
"source": "<FIXME-nextjs-internal-source>
╰─▶ × 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 'react-dom/server' cannot be imported from a Server Component module.
│ | To fix it, render or return the content directly as a Server Component instead for perf and security.
│ 1 | import * as ReactDOMServerEdge from 'react-dom/server'
│ 1 | import * as ReactDOMServerEdge from 'react-dom/server'
...
@@ -204,7 +205,8 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -204,7 +205,8 @@ describe('react-dom/server in React Server environment', () => {
│ 2 | // Fine to drop once React is on ESM
│ 2 | // Fine to drop once React is on ESM
│ 3 | import ReactDOMServerEdgeDefault from 'react-dom/server'
│ 3 | import ReactDOMServerEdgeDefault from 'react-dom/server'
│ \`----
│ \`----
│ 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.
│ x 'react-dom/server' cannot be imported from a Server Component module.
│ | To fix it, render or return the content directly as a Server Component instead for perf and security.
"description": " 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.",
"description": " x 'react-dom/server' cannot be imported from a Server Component module.",
"environmentLabel": null,
"environmentLabel": null,
"label": "Build Error",
"label": "Build Error",
"source": "<FIXME-nextjs-internal-source>
"source": "<FIXME-nextjs-internal-source>
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 'react-dom/server' cannot be imported from a Server Component module.
| To fix it, render or return the content directly as a Server Component instead for perf and security.
1 | import * as ReactDOMServerEdge from 'react-dom/server'
1 | import * as ReactDOMServerEdge from 'react-dom/server'
...
@@ -236,7 +239,8 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -236,7 +239,8 @@ describe('react-dom/server in React Server environment', () => {
2 | // Fine to drop once React is on ESM
2 | // Fine to drop once React is on ESM
3 | import ReactDOMServerEdgeDefault from 'react-dom/server'
3 | import ReactDOMServerEdgeDefault from 'react-dom/server'
\`----
\`----
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.
x 'react-dom/server' cannot be imported from a Server Component module.
| To fix it, render or return the content directly as a Server Component instead for perf and security.
1 | import * as ReactDOMServerEdge from 'react-dom/server'
1 | import * as ReactDOMServerEdge from 'react-dom/server'
...
@@ -340,9 +344,10 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -340,9 +344,10 @@ describe('react-dom/server in React Server environment', () => {
}elseif(isRspack){
}elseif(isRspack){
expect(redbox).toMatchInlineSnapshot(`
expect(redbox).toMatchInlineSnapshot(`
{
{
"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.",
"description": " ╰─▶ × Error: x 'react-dom/server' cannot be imported from a Server Component module.",
╰─▶ × 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 'react-dom/server' cannot be imported from a Server Component module.
│ | To fix it, render or return the content directly as a Server Component instead for perf and security.
│ 1 | import * as ReactDOMServerNode from 'react-dom/server'
│ 1 | import * as ReactDOMServerNode from 'react-dom/server'
...
@@ -350,7 +355,8 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -350,7 +355,8 @@ describe('react-dom/server in React Server environment', () => {
│ 2 | // Fine to drop once React is on ESM
│ 2 | // Fine to drop once React is on ESM
│ 3 | import ReactDOMServerNodeDefault from 'react-dom/server'
│ 3 | import ReactDOMServerNodeDefault from 'react-dom/server'
│ \`----
│ \`----
│ 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.
│ x 'react-dom/server' cannot be imported from a Server Component module.
│ | To fix it, render or return the content directly as a Server Component instead for perf and security.
│ 1 | import * as ReactDOMServerNode from 'react-dom/server'
│ 1 | import * as ReactDOMServerNode from 'react-dom/server'
...
@@ -366,9 +372,10 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -366,9 +372,10 @@ describe('react-dom/server in React Server environment', () => {
}else{
}else{
expect(redbox).toMatchInlineSnapshot(`
expect(redbox).toMatchInlineSnapshot(`
{
{
"description": " 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.",
"description": " x 'react-dom/server' cannot be imported from a Server Component module.",
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 'react-dom/server' cannot be imported from a Server Component module.
| To fix it, render or return the content directly as a Server Component instead for perf and security.
1 | import * as ReactDOMServerNode from 'react-dom/server'
1 | import * as ReactDOMServerNode from 'react-dom/server'
...
@@ -376,7 +383,8 @@ describe('react-dom/server in React Server environment', () => {
...
@@ -376,7 +383,8 @@ describe('react-dom/server in React Server environment', () => {
2 | // Fine to drop once React is on ESM
2 | // Fine to drop once React is on ESM
3 | import ReactDOMServerNodeDefault from 'react-dom/server'
3 | import ReactDOMServerNodeDefault from 'react-dom/server'
\`----
\`----
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.
x 'react-dom/server' cannot be imported from a Server Component module.
| To fix it, render or return the content directly as a Server Component instead for perf and security.