Skip to content

Commit daa802a

Browse files
Merge pull request web-fragments#9 from 1000hz/history-api-no-op-setters
fix(reframed): add no-op setter on patched History methods
2 parents a7a05ba + 9d9e047 commit daa802a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/reframed/src/reframed.ts

+7
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,13 @@ const originalHistoryFns = new Map();
418418
}
419419
};
420420
},
421+
// QwikCity tries to monkey-patch `pushState` and `replaceState`
422+
// which results in a runtime error:
423+
// TypeError: Cannot set property pushState of #<History> which only has a getter
424+
// so we need to add a no-op setter.
425+
// TODO: come up with a better workaround that doesn't break Qwik.
426+
// https://github.com/QwikDev/qwik/blob/3c5e5a7614c3f64cbf89f1304dd59609053eddf0/packages/qwik-city/runtime/src/spa-init.ts#L127-L135
427+
set: () => {},
421428
});
422429
});
423430

0 commit comments

Comments
 (0)