refactor(theme-common): change storageUtils useSyncExternalCode getSnapshot workaround #5453
Annotations
8 errors
Tabs › accept querystring=true when groupId is defined:
packages/docusaurus-theme-common/src/utils/storageUtils.ts#L116
expect(received).not.toThrow()
Error name: "Error"
Error message: "Illegal storage API usage for storage key \"docusaurus.tab.my-group-idundefined\".
Docusaurus storage APIs are not supposed to be called on the server-rendering process.
Please only call storage APIs in effects and event handlers."
114 | function createServerStorageSlot(key: string): StorageSlot {
115 | function throwError(): never {
> 116 | throw new Error(`Illegal storage API usage for storage key "${key}".
| ^
117 | Docusaurus storage APIs are not supposed to be called on the server-rendering process.
118 | Please only call storage APIs in effects and event handlers.`);
119 | }
at Object.throwError (packages/docusaurus-theme-common/src/utils/storageUtils.ts:116:11)
at packages/docusaurus-theme-common/src/utils/storageUtils.ts:231:23
at mountSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6073:20)
at Object.useSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6958:14)
at useSyncExternalStore (node_modules/react/cjs/react.development.js:1676:21)
at useStorageSlot (packages/docusaurus-theme-common/src/utils/storageUtils.ts:229:44)
at useTabStorage (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:209:46)
at useTabs (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:241:43)
at TabsComponent (packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx:142:23)
at renderWithHooks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5608:18)
at mountIndeterminateComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9884:13)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11351:16)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15850:12)
at workLoopSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15784:5)
at renderRootSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15756:7)
at performSyncWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15461:20)
at flushSyncCallbacks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2597:22)
at flushSyncCallbacksOnlyInLegacyMode (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2576:5)
at scheduleUpdateOnFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14949:7)
at updateContainer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17809:5)
at Object.create (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:18549:3)
at create (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:164:16)
at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:74:11)
at Object.throwingMatcher [as toThrow] (node_modules/expect/build/index.js:320:21)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
|
Tests (22)
Process completed with exit code 1.
|
Tests (20)
The job was canceled because "_22" failed.
|
Tabs › accept querystring=true when groupId is defined:
packages/docusaurus-theme-common/src/utils/storageUtils.ts#L116
expect(received).not.toThrow()
Error name: "Error"
Error message: "Illegal storage API usage for storage key \"docusaurus.tab.my-group-idundefined\".
Docusaurus storage APIs are not supposed to be called on the server-rendering process.
Please only call storage APIs in effects and event handlers."
114 | function createServerStorageSlot(key: string): StorageSlot {
115 | function throwError(): never {
> 116 | throw new Error(`Illegal storage API usage for storage key "${key}".
| ^
117 | Docusaurus storage APIs are not supposed to be called on the server-rendering process.
118 | Please only call storage APIs in effects and event handlers.`);
119 | }
at Object.throwError (packages/docusaurus-theme-common/src/utils/storageUtils.ts:116:11)
at packages/docusaurus-theme-common/src/utils/storageUtils.ts:231:23
at mountSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6073:20)
at Object.useSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6958:14)
at useSyncExternalStore (node_modules/react/cjs/react.development.js:1676:21)
at useStorageSlot (packages/docusaurus-theme-common/src/utils/storageUtils.ts:229:44)
at useTabStorage (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:209:46)
at useTabs (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:241:43)
at TabsComponent (packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx:142:23)
at renderWithHooks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5608:18)
at mountIndeterminateComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9884:13)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11351:16)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15850:12)
at workLoopSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15784:5)
at renderRootSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15756:7)
at performSyncWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15461:20)
at flushSyncCallbacks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2597:22)
at flushSyncCallbacksOnlyInLegacyMode (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2576:5)
at scheduleUpdateOnFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14949:7)
at updateContainer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17809:5)
at Object.create (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:18549:3)
at create (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:164:16)
at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:74:11)
at Object.throwingMatcher [as toThrow] (node_modules/expect/build/index.js:320:21)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
|
Tests (20)
The operation was canceled.
|
Tests (18.0)
The job was canceled because "_22" failed.
|
Tabs › accept querystring=true when groupId is defined:
packages/docusaurus-theme-common/src/utils/storageUtils.ts#L116
expect(received).not.toThrow()
Error name: "Error"
Error message: "Illegal storage API usage for storage key \"docusaurus.tab.my-group-idundefined\".
Docusaurus storage APIs are not supposed to be called on the server-rendering process.
Please only call storage APIs in effects and event handlers."
114 | function createServerStorageSlot(key: string): StorageSlot {
115 | function throwError(): never {
> 116 | throw new Error(`Illegal storage API usage for storage key "${key}".
| ^
117 | Docusaurus storage APIs are not supposed to be called on the server-rendering process.
118 | Please only call storage APIs in effects and event handlers.`);
119 | }
at Object.throwError (packages/docusaurus-theme-common/src/utils/storageUtils.ts:116:11)
at packages/docusaurus-theme-common/src/utils/storageUtils.ts:231:23
at mountSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6073:20)
at Object.useSyncExternalStore (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6958:14)
at useSyncExternalStore (node_modules/react/cjs/react.development.js:1676:21)
at useStorageSlot (packages/docusaurus-theme-common/src/utils/storageUtils.ts:229:44)
at useTabStorage (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:209:46)
at useTabs (packages/docusaurus-theme-common/src/utils/tabsUtils.tsx:241:43)
at TabsComponent (packages/docusaurus-theme-classic/src/theme/Tabs/index.tsx:142:23)
at renderWithHooks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:5608:18)
at mountIndeterminateComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9884:13)
at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:11351:16)
at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15850:12)
at workLoopSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15784:5)
at renderRootSync (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15756:7)
at performSyncWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:15461:20)
at flushSyncCallbacks (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2597:22)
at flushSyncCallbacksOnlyInLegacyMode (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2576:5)
at scheduleUpdateOnFiber (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:14949:7)
at updateContainer (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:17809:5)
at Object.create (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:18549:3)
at create (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:164:16)
at Object.<anonymous> (node_modules/expect/build/toThrowMatchers.js:74:11)
at Object.throwingMatcher [as toThrow] (node_modules/expect/build/index.js:320:21)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
at Object.toThrow (packages/docusaurus-theme-classic/src/theme/Tabs/__tests__/index.test.tsx:172:12)
|
Tests (18.0)
The operation was canceled.
|