Skip to content

Commit c55d03f

Browse files
authored
Don't dispose store in SSR (#210)
1 parent 32090ec commit c55d03f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/spicy-eels-sleep.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'docusaurus-theme-redoc': patch
3+
---
4+
5+
Fix worker.terminate error in SSR

packages/docusaurus-theme-redoc/src/utils/useSpec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ export function useSpec(
5959
optionsOverrides,
6060
);
6161

62-
if (currentStore !== null) {
62+
if (currentStore !== null && isBrowser) {
6363
currentStore.dispose();
6464
}
65+
6566
currentStore = new AppStore(
6667
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6768
spec as any,

0 commit comments

Comments
 (0)