Skip to content

Commit

Permalink
fix: cf pages polyfill only if needed (#5507)
Browse files Browse the repository at this point in the history
fix: polyfill only if needed
  • Loading branch information
mpeg authored Nov 30, 2023
1 parent 450d736 commit 217f58c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/qwik-city/middleware/cloudflare-pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import { setServerPlatform } from '@builder.io/qwik/server';

/** @public */
export function createQwikCity(opts: QwikCityCloudflarePagesOptions) {
(globalThis as any).TextEncoderStream = TextEncoderStream;
if (typeof globalThis.TextEncoderStream === 'undefined') {
(globalThis as any).TextEncoderStream = TextEncoderStream;
}
const qwikSerializer = {
_deserializeData,
_serializeData,
Expand Down

0 comments on commit 217f58c

Please sign in to comment.