8000 disallow usage of CacheSignal in edge runtime · vercel/next.js@575ed2a · GitHub
[go: up one dir, main page]

Skip to content

Commit 575ed2a

Browse files
committed
disallow usage of CacheSignal in edge runtime
1 parent 79a270c commit 575ed2a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/next/src/server/app-render/cache-signal.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ export class CacheSignal {
1616

1717
private subscribedSignals: Set<CacheSignal> | null = null
1818

19+
constructor() {
20+
if (process.env.NEXT_RUNTIME === 'edge') {
21+
// we rely on `process.nextTick`, which is not supported in edge
22+
throw new InvariantError(
23+
'CacheSignal cannot be used in the edge runtime.'
24+
)
25+
}
26+
}
27+
1928
private noMorePendingCaches() {
2029
if (!this.tickPending) {
2130
this.tickPending = true

0 commit comments

Comments
 (0)
0