Skip to content

Commit bf1a6f6

Browse files
authored
fix: type error during build (#883)
1 parent dc3dbe7 commit bf1a6f6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/polite-poems-fall.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
fix: type error during build

packages/cloudflare/src/api/overrides/incremental-cache/regional-cache.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class RegionalCache implements IncrementalCache {
9797
}
9898

9999
get #hasAutomaticCachePurging() {
100-
const cdnInvalidation = globalThis.openNextConfig.default?.override?.cdnInvalidation;
100+
// The `?` is required at `openNextConfig?` or the Open Next build fails because of a type error
101+
const cdnInvalidation = globalThis.openNextConfig?.default?.override?.cdnInvalidation;
101102

102103
return cdnInvalidation !== undefined && cdnInvalidation !== "dummy";
103104
}

0 commit comments

Comments
 (0)