Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack 5? #23

Closed
oliversturm opened this issue Apr 16, 2021 · 6 comments
Closed

Webpack 5? #23

oliversturm opened this issue Apr 16, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@oliversturm
Copy link

I followed the instructions to upgrade to the latest Storybook pre-release version, in order to go to Webpack 5 (because I have trouble with the lack of optional chaining support in Webpack 4).

I have two results:

  1. I can now run storybook in my project - there are no more Webpack errors due to optional chaining syntax.
  2. All my stories are gone, where 'gone' means undetected by Storybook and thus entirely invisible.

I suspect incompatibilities between the Webpack 5 compatible Storybook pre-release and this addon. In case I'm wrong and this is an issue that requires lots of research, I'll gladly debug and supply many details - but right now I assume that those in the know will say something along the lines of "obviously this can't possibly work right now, you dumb fool". So please go ahead!

@oliversturm oliversturm added the bug Something isn't working label Apr 16, 2021
@j3rem1e
Copy link
Contributor

j3rem1e commented Apr 16, 2021

The last time I checked it worked with webpack 5. Do you have any errors in the console ?

@oliversturm
Copy link
Author

No, it all looks very good. Here's my .storybook/main.js:

module.exports = {
  stories: ['../src/**/*.stories.svelte'],
  addons: [
    '@storybook/addon-svelte-csf',
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    {
      name: '@storybook/addon-postcss',
      options: {
        postcssLoaderOptions: {
          implementation: require('postcss'),
        },
      },
    },
  ],
  core: { builder: 'webpack5' },
};

Here are all the (probably?) relevant entries from package.json:

  "devDependencies": {
    ...
    "@storybook/addon-actions": "^6.3.0-alpha.8",
    "@storybook/addon-essentials": "^6.3.0-alpha.8",
    "@storybook/addon-links": "^6.3.0-alpha.8",
    "@storybook/addon-postcss": "^2.0.0",
    "@storybook/addon-svelte-csf": "^1.0.0",
    "@storybook/builder-webpack5": "^6.3.0-alpha.8",
    "@storybook/svelte": "^6.3.0-alpha.8",
    "svelte": "^3.35.0",
    "svelte-loader": "^3.0.0",
    "svelte-preprocess": "^4.6.1",
    ...
  }

And this is what I see on startup:

➜ npm run storybook

> [email protected] storybook
> start-storybook -p 6006

info @storybook/svelte v6.3.0-alpha.8
info
info => Loading presets
info => Loading 1 config file in "/home/sturm/.../ggui-svelte/.storybook"
info => Loading 7 other files in "/home/sturm/.../ggui-svelte/.storybook"
WARN unable to find package.json for @rollup/plugin-node-resolve
WARN unable to find package.json for rollup
WARN unable to find package.json for rollup-plugin-import-css
WARN unable to find package.json for rollup-plugin-terser
WARN unable to find package.json for snowpack
info => Adding stories defined in "/home/sturm/.../ggui-svelte/.storybook/main.js"
info => Using PostCSS preset with [email protected]
info => Using default Webpack5 setup
<i> [webpack-dev-middleware] wait until bundle finished
10% building 0/1 entries 0/0 dependencies 0/0 modulesinfo => Using cached manager
<i> [webpack-dev-middleware] wait until bundle finished: /__webpack_hmr
99% done plugins webpack-hot-middlewarewebpack built preview 799bc8231debd7050162 in 28802ms
╭────────────────────────────────────────────────╮
│                                                │
│   Storybook 6.3.0-alpha.8 started              │
│   29 s for preview                             │
│                                                │
│    Local:            http://localhost:6006/    │
│    On your network:  http://10.0.0.40:6006/    │
│                                                │
╰────────────────────────────────────────────────╯
<i> [webpack-dev-middleware] wait until bundle finished: /iframe.html?id=overview--list&viewMode=story
<i> [webpack-dev-middleware] wait until bundle finished: /
99% done plugins webpack-hot-middlewarewebpack built preview d97863093d5b67e2663e in 701ms

Any ideas where I could look for this problem? It was working yesterday - only then I tried to add pdfjs-dist to the project, which uses optional chaining syntax, and I decided to solve that problem by going to Webpack 5 and then the stories were gone!

I can see that the only differences in the project are the added line (core ...) in .storybook/main.js and the changed lines in package.json. Here's the diff:

+++ b/frontend/ggui-svelte/package.json
@@ -34,12 +34,13 @@
     "@rollup/plugin-replace": "^2.4.2",
     "@snowpack/plugin-postcss": "^1.2.1",
     "@snowpack/plugin-svelte": "^3.6.0",
-    "@storybook/addon-actions": "^6.2.0-rc.8",
-    "@storybook/addon-essentials": "^6.2.0-rc.8",
-    "@storybook/addon-links": "^6.2.0-rc.8",
+    "@storybook/addon-actions": "^6.3.0-alpha.8",
+    "@storybook/addon-essentials": "^6.3.0-alpha.8",
+    "@storybook/addon-links": "^6.3.0-alpha.8",
     "@storybook/addon-postcss": "^2.0.0",
     "@storybook/addon-svelte-csf": "^1.0.0",
-    "@storybook/svelte": "^6.2.0-rc.8",
+    "@storybook/builder-webpack5": "^6.3.0-alpha.8",
+    "@storybook/svelte": "^6.3.0-alpha.8",
     "autoprefixer": "^10.1.0",
     "babel-jest": "^26.6.3",
     "babel-loader": "^8.2.2",
@@ -53,6 +54,7 @@
     "jest-cli": "^26.6.3",
     "lodash-es": "^4.17.21",
     "npm-run-all": "^4.1.5",
+    "pdfjs-dist": "^2.7.570",
     "postcss": "^8.2.7",
     "postcss-apply": "^0.12.0",
     "postcss-cli": "^8.3.1",

@j3rem1e
Copy link
Contributor

j3rem1e commented Apr 16, 2021

I don't think it's a good idea to use storybook 6.3.0-alpha, it's not a stable version.
Could you please dump too the content of your browser console in the devtools ? thanks 🙏

@oliversturm
Copy link
Author

The version is what I got when I followed the instructions.

Also - wow, I never knew the browser console would have so much info in a case like this :) I don't have time right now to look into it in detail, this certainly looks very informative.

vendors~main.manager.bundle.js:28788 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.
(anonymous) @ vendors~main.manager.bundle.js:28788
vendors~main.manager.bundle.js:25967 Download the React DevTools for a better development experience: https://fb.me/react-devtools
browser.js:39 `configure()` is deprecated and will be removed in Storybook 7.0. 
Please use the `stories` field of `main.js` to load stories.
Read more at https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-configure
deprecated @ browser.js:39
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/IssueCard.stories.svelte (main.iframe.bundle.js:4786)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/IssueCard.stories.svelte: TypeError: Cannot read property 'NormalSizeNoSearch' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/Overview.stories.svelte (main.iframe.bundle.js:5141)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/Overview.stories.svelte: TypeError: Cannot read property 'NoListNull' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/PdfViewer.stories.svelte (main.iframe.bundle.js:5307)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/PdfViewer.stories.svelte: TypeError: Cannot read property 'One' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/SearchAbstract.stories.svelte (main.iframe.bundle.js:5493)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/SearchAbstract.stories.svelte: TypeError: Cannot read property 'Simple' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/SearchField.stories.svelte (main.iframe.bundle.js:5661)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/SearchField.stories.svelte: TypeError: Cannot read property 'Standard' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/AppBar.stories.svelte (main.iframe.bundle.js:5900)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/AppBar.stories.svelte: TypeError: Cannot read property 'ThreeRoutes' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/AppMenuButton.stories.svelte (main.iframe.bundle.js:6069)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/AppMenuButton.stories.svelte: TypeError: Cannot read property 'Primary' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/LoadingSpinner.stories.svelte (main.iframe.bundle.js:6226)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/LoadingSpinner.stories.svelte: TypeError: Cannot read property 'Standard' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/MainMenuDropdown.stories.svelte (main.iframe.bundle.js:6461)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/MainMenuDropdown.stories.svelte: TypeError: Cannot read property 'Primary' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/MainMenuItem.stories.svelte (main.iframe.bundle.js:6677)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/MainMenuItem.stories.svelte: TypeError: Cannot read property 'Primary' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/Notification.stories.svelte (main.iframe.bundle.js:6979)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/Notification.stories.svelte: TypeError: Cannot read property 'Info' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/PopupMenu.stories.svelte (main.iframe.bundle.js:7213)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/PopupMenu.stories.svelte: TypeError: Cannot read property 'Primary' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/PopupMenuButton.stories.svelte (main.iframe.bundle.js:7442)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/PopupMenuButton.stories.svelte: TypeError: Cannot read property 'Primary' of undefined
warn @ index.js:47
index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization
    at get_current_component (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184157)
    at setContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:184187)
    at createRegistrationContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:13958)
    at instance (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7306)
    at init (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:186922)
    at new RegisterContext (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:7319)
    at _default (vendors-node_modules_storybook_addon-actions_dist_esm_preset_addArgs_js-generated-other-entry-ebd372.iframe.bundle.js:14090)
    at Module../src/stories/app-template/Tippy.stories.svelte (main.iframe.bundle.js:7680)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28)
    at fn (runtime~main.iframe.bundle.js:307)
error @ index.js:54
index.js:54 Missing <Meta/> tag
error @ index.js:54
index.js:47 Unexpected error while loading ./stories/app-template/Tippy.stories.svelte: TypeError: Cannot read property 'Standard' of undefined
warn @ index.js:47
vendors~main.manager.bundle.js:36791 Tried to update globals but the old and new values are equal.
DevTools failed to load SourceMap: Could not load content for http://localhost:6006/react-inspector.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load SourceMap: Could not load content for http://localhost:6006/react-popper-tooltip.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

@j3rem1e
Copy link
Contributor

j3rem1e commented Apr 16, 2021

index.js:54 Error extracting stories Error: Function called outside component initialization Error: Function called outside component initialization

You bundle two svelte runtimes.

add this to your exports in .storybook/main.js

webpackFinal: (config) => {
    config.resolve.alias.svelte = path.resolve('node_modules', 'svelte')
    return config;
  },

@j3rem1e j3rem1e closed this as completed Apr 20, 2021
@oliversturm
Copy link
Author

oliversturm commented Apr 21, 2021

Excellent, that solved my problem. Very nice find! Now, for my understanding - how do I end up bundling two Svelte runtimes? Any ideas?

(Edit: I checked, because I thought you were referring to conflicting versions - I have only one Svelte package anywhere in node_modules and its nested folders. So is it something I did wrong in my setup that resulted in two runtime instances getting each other in trouble?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants