Files
JJ KasperandGitHub 900a807dc4 Fix legacy env case with experimental tracing (#70411)
This ensures `env` keys in `next.config` are properly exposed during
page collecting step during build since the inlining step comes after.

x-ref: https://github.com/vercel/next.js/pull/70380
x-ref:
https://vercel.com/vercel/vercel-site/9WqUX9vu15oVEy1acDqoXddcH27K?filter=errors
2024-09-24 13:28:39 -07:00

20 lines
364 B
JavaScript

import { useRouter } from 'next/router'
export default function Page(props) {
return (
<>
<p>hello from ssg</p>
<p id="query">{JSON.stringify(useRouter().query)}</p>
</>
)
}
export function getStaticProps() {
if (!process.env.LEGACY_ENV_KEY) {
throw new Error('missing env key LEGACY_ENV_KEY!!')
}
return {
props: {},
}
}