mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This fixes the prefetching handling when middleware is present as currently we are incorrectly triggering data requests for non-SSG pages to handle the case where a middleware rewrite is present and pointing to an SSG path. Since the majority use case won't be rewriting in middleware and this incurs a lot of potentially heavy requests to `getServerSideProps` paths this matches the prefetch handling when middleware isn't present and only prefetches the data route when we match an SSG path. Fixes: [slack thread](https://vercel.slack.com/archives/C0289CGVAR2/p1661364670589519?thread_ts=1661199566.675759&cid=C0289CGVAR2) Fixes: https://github.com/vercel/next.js/issues/38918 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
15 lines
219 B
JavaScript
15 lines
219 B
JavaScript
export default function Main({ now }) {
|
|
return (
|
|
<div>
|
|
<h1 id="ssg">SSG Page</h1>
|
|
<p id="now">{now}</p>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const getStaticProps = () => ({
|
|
props: {
|
|
now: Date.now(),
|
|
},
|
|
})
|