Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance warning messages about unanalyzable
config
field (#38907
) x-ref: #38750 x-ref: #38750 (comment) cc @ijjk The PR implements the details about un-extractable fields in the `UnsupportedValueError`. The PR also enhances the warning message about the unrecognizable `config` field. Now the warning message will look like this: ``` warn - Next.js can't recognize the exported `config` field in route "/unsupported-value-type": Unsupported node type "CallExpression" at "config.runtime". The default config will be used instead. Read More - https://nextjs.org/docs/messages/invalid-page-config ``` The corresponding production test case has also been updated.
- Loading branch information
Showing
10 changed files
with
200 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../exported-runtimes-value-validation/unsupported-syntax/app/pages/array-spread-operator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
export const config = { | ||
runtime: [...['nodejs']], | ||
} |
7 changes: 7 additions & 0 deletions
7
...tion/exported-runtimes-value-validation/unsupported-syntax/app/pages/binary-expression.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
export const config = { | ||
runtime: 1 + 1 > 2, | ||
} |
9 changes: 9 additions & 0 deletions
9
...ion/exported-runtimes-value-validation/unsupported-syntax/app/pages/invalid-identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
const runtime = Symbol('runtime') | ||
|
||
export const config = { | ||
runtime: runtime, | ||
} |
7 changes: 7 additions & 0 deletions
7
...exported-runtimes-value-validation/unsupported-syntax/app/pages/object-spread-operator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
export const config = { | ||
runtime: { ...{ a: 'b' } }, | ||
} |
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
...exported-runtimes-value-validation/unsupported-syntax/app/pages/unsupported-object-key.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
export const config = { | ||
runtime: { | ||
[Symbol('nodejs')]: true, | ||
}, | ||
} |
7 changes: 7 additions & 0 deletions
7
...exported-runtimes-value-validation/unsupported-syntax/app/pages/unsupported-value-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function Page() { | ||
return <p>hello world</p> | ||
} | ||
|
||
export const config = { | ||
runtime: Symbol('nodejs'), | ||
} |