You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading storybook/react to 6.5.13 (from 6.4.22) I suddenly have problems with storybook-dark-mode not wanting to load because window is undefined. See the full callstack below. I was on [email protected], upgraded to 1.1.2. Same error in both versions.
Failed to load preset: {"type":"presets","name":"/app/.yarn/__virtual__/storybook-dark-mode-virtual-6715300bd7/0/cache/storybook-dark-mode-npm-1.1.2-ecc4605688-8.zip/node_modules/storybook-dark-mode/dist/index.js"} on level 1
ERR! TypeError: Cannot read property 'matchMedia' of undefined
ERR! at Object.<anonymous> (/app/.yarn/__virtual__/storybook-dark-mode-virtual-6715300bd7/0/cache/storybook-dark-mode-npm-1.1.2-ecc4605688-8.zip/node_modules/storybook-dark-mode/dist/Tool.js:64:30)
ERR! at Module._compile (internal/modules/cjs/loader.js:1085:14)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
ERR! at Module.load (internal/modules/cjs/loader.js:950:32)
ERR! at Function.external_module_.Module._load (/app/.pnp.cjs:48904:14)
ERR! at Module.require (internal/modules/cjs/loader.js:974:19)
ERR! at require (internal/modules/cjs/helpers.js:101:18)
ERR! at Object.<anonymous> (/app/.yarn/__virtual__/storybook-dark-mode-virtual-6715300bd7/0/cache/storybook-dark-mode-npm-1.1.2-ecc4605688-8.zip/node_modules/storybook-dark-mode/dist/index.js:28:14)
ERR! at Module._compile (internal/modules/cjs/loader.js:1085:14)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
ERR! at Module.load (internal/modules/cjs/loader.js:950:32)
ERR! at Function.external_module_.Module._load (/app/.pnp.cjs:48904:14)
ERR! at Module.require (internal/modules/cjs/loader.js:974:19)
ERR! at require (internal/modules/cjs/helpers.js:101:18)
ERR! at interopRequireDefault (/app/.yarn/__virtual__/@storybook-core-common-virtual-5880bee6e4/0/cache/@storybook-core-common-npm-6.5.13-49981d30f1-8.zip/node_modules/@storybook/core-common/dist/cjs/presets.js:178:16)
ERR! at getContent (/app/.yarn/__virtual__/@storybook-core-common-virtual-5880bee6e4/0/cache/@storybook-core-common-npm-6.5.13-49981d30f1-8.zip/node_modules/@storybook/core-common/dist/cjs/presets.js:194:10)
ERR! TypeError: Cannot read property 'matchMedia' of undefined
ERR! at Object.<anonymous> (/app/.yarn/__virtual__/storybook-dark-mode-virtual-6715300bd7/0/cache/storybook-dark-mode-npm-1.1.2-ecc4605688-8.zip/node_modules/storybook-dark-mode/dist/Tool.js:64:30)
ERR! at Module._compile (internal/modules/cjs/loader.js:1085:14)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
ERR! at Module.load (internal/modules/cjs/loader.js:950:32)
ERR! at Function.external_module_.Module._load (/app/.pnp.cjs:48904:14)
ERR! at Module.require (internal/modules/cjs/loader.js:974:19)
ERR! at require (internal/modules/cjs/helpers.js:101:18)
ERR! at Object.<anonymous> (/app/.yarn/__virtual__/storybook-dark-mode-virtual-6715300bd7/0/cache/storybook-dark-mode-npm-1.1.2-ecc4605688-8.zip/node_modules/storybook-dark-mode/dist/index.js:28:14)
ERR! at Module._compile (internal/modules/cjs/loader.js:1085:14)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
ERR! at Module.load (internal/modules/cjs/loader.js:950:32)
ERR! at Function.external_module_.Module._load (/app/.pnp.cjs:48904:14)
ERR! at Module.require (internal/modules/cjs/loader.js:974:19)
ERR! at require (internal/modules/cjs/helpers.js:101:18)
ERR! at interopRequireDefault (/app/.yarn/__virtual__/@storybook-core-common-virtual-5880bee6e4/0/cache/@storybook-core-common-npm-6.5.13-49981d30f1-8.zip/node_modules/@storybook/core-common/dist/cjs/presets.js:178:16)
ERR! at getContent (/app/.yarn/__virtual__/@storybook-core-common-virtual-5880bee6e4/0/cache/@storybook-core-common-npm-6.5.13-49981d30f1-8.zip/node_modules/@storybook/core-common/dist/cjs/presets.js:194:10)
The text was updated successfully, but these errors were encountered:
edda
changed the title
Cannot read property 'matchMedia' of undefined -- window is null
Cannot read property 'matchMedia' of undefined -- window is undefined
Nov 2, 2022
After upgrading storybook/react to 6.5.13 (from 6.4.22) I suddenly have problems with storybook-dark-mode not wanting to load because
window
is undefined. See the full callstack below. I was on [email protected], upgraded to 1.1.2. Same error in both versions.I'm using webpack5, [email protected]
Any ideas what could be going wrong here?
The text was updated successfully, but these errors were encountered: