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
The Rundown
Trying to run Storybook results in the error listed below. Upon further research I found that in the file node_modules/@storybook/svelte/dist/client/preview/globals.js a string with the value of "svelte" is trying to be assigned to the property STORYBOOK_ENV on the non-existent window property on _global (Code included below for clarity). Setting window equal to an empty object does stop the error from occurring BUT then the Storybook webpage no longer loads.
I followed the tutorial for @storybook/addon-viewport that can be found here. The tutorial is specifically for React but I figured the logic would be the same for Svelte. Has anyone else encountered this problem/ is there a fix?
TypeError: Cannot set property 'STORYBOOK_ENV' of undefined
ERR! at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/preview/globals.js:5:30)
ERR! at Module._compile (internal/modules/cjs/loader.js:971:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)
ERR! at Module.load (internal/modules/cjs/loader.js:822:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:730:14)
ERR! at Module.require (internal/modules/cjs/loader.js:864:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/preview/index.js:12:1)
ERR! at Module._compile (internal/modules/cjs/loader.js:971:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)
ERR! at Module.load (internal/modules/cjs/loader.js:822:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:730:14)
ERR! at Module.require (internal/modules/cjs/loader.js:864:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/index.js:55:16)
ERR! at Module._compile (internal/modules/cjs/loader.js:971:30) {
ERR! stack: "TypeError: Cannot set property 'STORYBOOK_ENV' of undefined\n" +
ERR! ' at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/preview/globals.js:5:30)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:971:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:822:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:730:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:864:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/preview/index.js:12:1)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:971:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:822:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:730:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:864:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/khaled/Sites/clients/bdc/node_modules/@storybook/svelte/dist/client/index.js:55:16)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:971:30)'
ERR! }
The text was updated successfully, but these errors were encountered:
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
The Rundown
Trying to run Storybook results in the error listed below. Upon further research I found that in the file
node_modules/@storybook/svelte/dist/client/preview/globals.js
a string with the value of"svelte"
is trying to be assigned to the propertySTORYBOOK_ENV
on the non-existentwindow
property on_global
(Code included below for clarity). Setting window equal to an empty object does stop the error from occurring BUT then the Storybook webpage no longer loads.I followed the tutorial for @storybook/addon-viewport that can be found here. The tutorial is specifically for React but I figured the logic would be the same for Svelte. Has anyone else encountered this problem/ is there a fix?
My code
The error
The text was updated successfully, but these errors were encountered: