Update rewrite dynamic SSG error (#13724)
This error isn't specific to just fallback SSG pages since any dynamic SSG page that is rewritten to can cause the `/_next/data` request to fail also since it currently derived from the the URL. This can also fail for `getServerSideProps` since it derives the `/_next/data` URL the same way so might need to be updated to show in that case also
This commit is contained in:
parent
1b36f0c029
commit
4e6eb5b3a7
2 changed files with 3 additions and 6 deletions
|
@ -382,9 +382,7 @@ export async function renderToHTML(
|
||||||
`Rewrites don't support${
|
`Rewrites don't support${
|
||||||
isFallback ? ' ' : ' auto-exported '
|
isFallback ? ' ' : ' auto-exported '
|
||||||
}dynamic pages${isFallback ? ' with getStaticProps ' : ' '}yet. ` +
|
}dynamic pages${isFallback ? ' with getStaticProps ' : ' '}yet. ` +
|
||||||
`Using this will cause the page to fail to parse the params on the client${
|
`Using this will cause the page to fail to parse the params on the client`
|
||||||
isFallback ? ' for the fallback page ' : ''
|
|
||||||
}`
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -557,12 +557,11 @@ const runTests = (dev = false, isEmulatedServerless = false) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
// TODO: re-enable when this is supported in dev
|
it('should show error when rewriting to dynamic SSG page', async () => {
|
||||||
it.skip('should show error when rewriting to dynamic SSG page', async () => {
|
|
||||||
const item = Math.round(Math.random() * 100)
|
const item = Math.round(Math.random() * 100)
|
||||||
const html = await renderViaHTTP(appPort, `/some-rewrite/${item}`)
|
const html = await renderViaHTTP(appPort, `/some-rewrite/${item}`)
|
||||||
expect(html).toContain(
|
expect(html).toContain(
|
||||||
`Rewrites don't support dynamic pages with getStaticProps yet. Using this will cause the page to fail to parse the params on the client for the fallback page`
|
`Rewrites don't support dynamic pages with getStaticProps yet. Using this will cause the page to fail to parse the params on the client`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue