Unverified Commit bc3e597a authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

Fix export statement validations for app router pages (#75278)

Fixes all issues related to the current export statement validation for
app router pages, as highlighted in #75277.
parent eadb5667
...@@ -4531,6 +4531,7 @@ dependencies = [ ...@@ -4531,6 +4531,7 @@ dependencies = [
"either", "either",
"fxhash", "fxhash",
"hex", "hex",
"indexmap 2.5.0",
"indoc", "indoc",
"lazy_static", "lazy_static",
"modularize_imports", "modularize_imports",
......
...@@ -19,6 +19,7 @@ easy-error = "1.0.0" ...@@ -19,6 +19,7 @@ easy-error = "1.0.0"
either = "1" either = "1"
fxhash = "0.2.1" fxhash = "0.2.1"
hex = "0.4.3" hex = "0.4.3"
indexmap = { workspace = true }
indoc = { workspace = true } indoc = { workspace = true }
once_cell = { workspace = true } once_cell = { workspace = true }
pathdiff = { workspace = true } pathdiff = { workspace = true }
......
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:// 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 = {}
: ^^^^^^^^
`----
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 | nextjs.org/docs/app/api-reference/directives/use-client
| |
| |
,-[input.js:5:1] ,-[input.js:3:1]
4 | 2 |
5 | export function getServerSideProps() {} 3 | export function generateMetadata() {}
: ^^^^^^^^^^^^^^^^^^ : ^^^^^^^^^^^^^^^^
`---- `----
x "getServerSideProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching x "getServerSideProps" is not supported in app/. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching
| |
......
x "dynamicParams" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. x Route segment config "runtime" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it.
,-[input.js:5:1] ,-[input.js:1:1]
4 | export const fetchCache = 'force-no-store' 1 | export const runtime = 'edge'
5 | export const revalidate = 1 : ^^^^^^^
: ^^^^^^^^^^ 2 | export const dynamic = 'force-dynamic'
`---- `----
x "dynamic" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. x Route segment config "dynamic" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it.
,-[input.js:5:1] ,-[input.js:2:1]
4 | export const fetchCache = 'force-no-store' 1 | export const runtime = 'edge'
5 | export const revalidate = 1 2 | export const dynamic = 'force-dynamic'
: ^^^^^^^^^^ : ^^^^^^^
3 | export const dynamicParams = false
`---- `----
x "fetchCache" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. x Route segment config "dynamicParams" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it.
,-[input.js:5:1] ,-[input.js:3:1]
2 | export const dynamic = 'force-dynamic'
3 | export const dynamicParams = false
: ^^^^^^^^^^^^^
4 | export const fetchCache = 'force-no-store' 4 | export const fetchCache = 'force-no-store'
5 | export const revalidate = 1
: ^^^^^^^^^^
`---- `----
x "runtime" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. x Route segment config "fetchCache" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it.
,-[input.js:5:1] ,-[input.js:4:1]
3 | export const dynamicParams = false
4 | export const fetchCache = 'force-no-store' 4 | export const fetchCache = 'force-no-store'
5 | export const revalidate = 1
: ^^^^^^^^^^ : ^^^^^^^^^^
5 | export const revalidate = 1
`---- `----
x "revalidate" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it. x Route segment config "revalidate" is not compatible with `nextConfig.experimental.dynamicIO`. Please remove it.
,-[input.js:5:1] ,-[input.js:5:1]
4 | export const fetchCache = 'force-no-store' 4 | export const fetchCache = 'force-no-store'
5 | export const revalidate = 1 5 | export const revalidate = 1
......
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 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] ,-[input.js:1:1]
1 | export const metadata = {}
: ^^^^^^^^
2 | 2 |
3 | export function generateMetadata() {} 3 | export function generateMetadata() {}
: ^^^^^^^^^^^^^^^^ : ^^^^^^^^^^^^^^^^
......
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