-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test fixtures demonstrating export statement validation bugs #75277
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function generateMetadata() {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function generateMetadata() {} | ||
export default function() { | ||
return null; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
x You are attempting to export "generateMetadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https:// | ||
| nextjs.org/docs/app/api-reference/directives/use-client | ||
| | ||
| | ||
,-[input.js:1:1] | ||
1 | export function generateMetadata() {} | ||
: ^^^^^^^^^^^^^^^^ | ||
`---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const metadata = {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const metadata = {}; | ||
export default function() { | ||
return null; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
x You are attempting to export "metadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://nextjs.org/ | ||
| docs/app/api-reference/directives/use-client | ||
| | ||
| | ||
,-[input.js:1:1] | ||
1 | export const metadata = {} | ||
: ^^^^^^^^ | ||
`---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const metadata = {} | ||
|
||
export function generateMetadata() {} | ||
|
||
export function getServerSideProps() {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const metadata = {}; | ||
export function generateMetadata() {} | ||
export function getServerSideProps() {} | ||
export default function() { | ||
return null; | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is completely off. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
x You are attempting to export "getServerSideProps" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https:// | ||
| nextjs.org/docs/app/api-reference/directives/use-client | ||
| | ||
| | ||
,-[input.js:5:1] | ||
4 | | ||
5 | export function getServerSideProps() {} | ||
: ^^^^^^^^^^^^^^^^^^ | ||
`---- | ||
x "getServerSideProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching | ||
| | ||
| | ||
,-[input.js:5:1] | ||
4 | | ||
5 | export function getServerSideProps() {} | ||
: ^^^^^^^^^^^^^^^^^^ | ||
`---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const runtime = 'edge' | ||
export const dynamic = 'force-dynamic' | ||
export const dynamicParams = false | ||
export const fetchCache = 'force-no-store' | ||
export const revalidate = 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const runtime = 'edge'; | ||
export const dynamic = 'force-dynamic'; | ||
export const dynamicParams = false; | ||
export const fetchCache = 'force-no-store'; | ||
export const revalidate = 1; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All five issues incorrectly report the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order of the reported issues is currently non-deterministic, which may lead to the |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
x "dynamicParams" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. | ||
,-[input.js:5:1] | ||
4 | export const fetchCache = 'force-no-store' | ||
5 | export const revalidate = 1 | ||
: ^^^^^^^^^^ | ||
`---- | ||
x "dynamic" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. | ||
,-[input.js:5:1] | ||
4 | export const fetchCache = 'force-no-store' | ||
5 | export const revalidate = 1 | ||
: ^^^^^^^^^^ | ||
`---- | ||
x "fetchCache" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. | ||
,-[input.js:5:1] | ||
4 | export const fetchCache = 'force-no-store' | ||
5 | export const revalidate = 1 | ||
: ^^^^^^^^^^ | ||
`---- | ||
x "runtime" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. | ||
,-[input.js:5:1] | ||
4 | export const fetchCache = 'force-no-store' | ||
5 | export const revalidate = 1 | ||
: ^^^^^^^^^^ | ||
`---- | ||
x "revalidate" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. | ||
,-[input.js:5:1] | ||
4 | export const fetchCache = 'force-no-store' | ||
5 | export const revalidate = 1 | ||
: ^^^^^^^^^^ | ||
`---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// generateMetadata without metadata is ok. | ||
export function generateMetadata() {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// generateMetadata without metadata is ok. | ||
export function generateMetadata() {} | ||
export default function() { | ||
return null; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const metadata = {} | ||
|
||
export function generateMetadata() {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const metadata = {}; | ||
export function generateMetadata() {} | ||
export default function() { | ||
return null; | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should ideally highlight both export statements. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
x "metadata" and "generateMetadata" cannot be exported at the same time, please keep one of them. Read more: https://nextjs.org/docs/app/api-reference/file-conventions/metadata | ||
| | ||
| | ||
,-[input.js:3:1] | ||
2 | | ||
3 | export function generateMetadata() {} | ||
: ^^^^^^^^^^^^^^^^ | ||
`---- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// metadata without generateMetadata is ok. | ||
export const metadata = {} | ||
|
||
export default function () { | ||
return null | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// metadata without generateMetadata is ok. | ||
export const metadata = {}; | ||
export default function() { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fly-by refactor to combine the
server-graph
andclient-graph
tests. Their config is identical apart fromis_react_server_layer
, which we now derive from the input path, i.e. by checking whetherserver-graph
is included in the path.