You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 10, 2021. It is now read-only.
* add support for preview mode of pre-rendered pages using getStaticProps
* remove README caveat
* Add Cypress tests: Optional catch-all route at root-level
Test that prerendered pages and static files from /public are correctly
served under the redirect engine used with cookie-based redirects when
having an optional catch-all route at root-level.
* Cleanup: Remove unnecessary require
We do not need `existsSync` in the `setupNetlifyFunctionForPage` helper.
* miscellaneous finishing touches for ssg preview mode
* move preview mode note in readme and update isroutewithfallback helper
Co-authored-by: Finn Woelm <[email protected]>
-[Fallbacks for Pages with `getStaticPaths`](#fallbacks-for-pages-with-getstaticpaths)
40
39
-[Credits](#credits)
41
40
-[Showcase](#showcase)
@@ -157,6 +156,12 @@ From now on, whenever you want to preview your application locally, just run:
157
156
1.`npm run build`: This will run `next build` to build your Next.js app and `next-on-netlify` to prepare your Next.js app for compatibility with Netlify
158
157
1.`netlify dev`: This will emulate Netlify on your computer and let you preview your app on `http://localhost:8888`.
159
158
159
+
*Note:*
160
+
161
+
Preview Mode is not yet available locally, running `netlify dev`, for static pages without revalidate or fallback. This will be supported soon.
162
+
163
+
For now, Preview Mode *is* supported in production for all Next.js page types.
164
+
160
165
#### Custom Netlify Redirects
161
166
162
167
You can define custom redirects in a `_redirects` and/or in your `netlify.toml` file.
@@ -175,10 +180,6 @@ SSR pages and API endpoints. It is currently not possible to create custom Netli
175
180
176
181
## Caveats
177
182
178
-
### Preview Mode
179
-
180
-
[Next.js Preview Mode](https://nextjs.org/docs/advanced-features/preview-mode) does not work on pages that are pre-rendered (pages with `getStaticProps`). Netlify currently does not support cookie-based redirects, which are needed for supporting preview mode on pre-rendered pages. Preview mode works correctly on any server-side-rendered pages (pages with `getInitialProps` or `getServerSideProps`). See: [Issue #10](https://github.com/netlify/next-on-netlify/issues/10)
181
-
182
183
### Fallbacks for Pages with `getStaticPaths`
183
184
184
185
[Fallback pages](https://nextjs.org/docs/basic-features/data-fetching#fallback-true) behave differently with `next-on-netlify` than they do with Next.js. On Next.js, when navigating to a path that is not defined in `getStaticPaths`, it first displays the fallback page. Next.js then generates the HTML in the background and caches it for future requests.
0 commit comments