Skip to content

Commit

Permalink
fix: don't cache /edit route in Next recipe
Browse files Browse the repository at this point in the history
Next.js cache was interfering with the dynamic `/puck` route in the next
recipe. Note, the regular route is behaving as expected.

This fix forces the /edit route to use dynamic rendering.

## Steps to reproduce

1. Clone the repo
2. Run yarn to install dependencies
3. Run yarn build to generate a build
4. Run yarn start to run the production build
5. Navigate to page editor
6. Reload the page
7. Make changes and hit the publish button
8. Reload the page 

## What happened

The old data was shown

## Wha I expected to happen

The new data to be shown
  • Loading branch information
chrisvxd authored Sep 7, 2024
1 parent cfecf54 commit 94f16b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions recipes/next/app/puck/[...puckPath]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ export default async function Page({

return <Client path={path} data={data || {}} />;
}

export const dynamic = "force-dynamic";
2 changes: 1 addition & 1 deletion recipes/next/app/puck/page.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, generateMetadata } from "./[...puckPath]/page";
export { default, generateMetadata, dynamic } from "./[...puckPath]/page";

0 comments on commit 94f16b2

Please sign in to comment.