forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compiler error when next/cache is used in a client module (verce…
…l#75979) Most functions in `next/cache` don't work on the client, and produce confusing error messages when called there. It's better to just ban them at compile time. NOTE: For legacy/compat reasons, we're allowing `unstable_cache` and `unstable_noStore`, since they don't currently throw when called.
- Loading branch information
1 parent
319a338
commit eac707f
Showing
11 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...tures/rsc-build-errors/app/server-with-errors/next-cache-in-client/revalidatepath/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { revalidatePath } from 'next/cache' | ||
|
||
console.log({ revalidatePath }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...xtures/rsc-build-errors/app/server-with-errors/next-cache-in-client/revalidatetag/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { revalidateTag } from 'next/cache' | ||
|
||
console.log({ revalidateTag }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...tures/rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_cache/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_cache } from 'next/cache' | ||
|
||
console.log({ unstable_cache }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_cachelife/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_cacheLife } from 'next/cache' | ||
|
||
console.log({ unstable_cacheLife }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...es/rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_cachetag/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_cacheTag } from 'next/cache' | ||
|
||
console.log({ unstable_cacheTag }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
.../rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_expirepath/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_expirePath } from 'next/cache' | ||
|
||
console.log({ unstable_expirePath }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_expiretag/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_expireTag } from 'next/cache' | ||
|
||
console.log({ unstable_expireTag }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
...res/rsc-build-errors/app/server-with-errors/next-cache-in-client/unstable_nostore/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use client' | ||
import { unstable_noStore } from 'next/cache' | ||
|
||
console.log({ unstable_noStore }) | ||
|
||
export default function Page() { | ||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters