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

Storybook still using Webpack, despite adding correct builder option #248

Closed
jamespantalones opened this issue Feb 18, 2022 · 2 comments
Closed

Comments

@jamespantalones
Copy link

jamespantalones commented Feb 18, 2022

Not sure what's going on exactly, but Webpack is still being used even after following instructions with a clean install.

Initialized a vite project using react and react-ts

npm init vite

Then added storybook and storybook-builder-vite:


npx sb@next init --builder storybook-builder-vite
npm run storybook

My current config:

module.exports = {
  stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.(js|jsx|ts|tsx)"],
  addons: [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
  ],
  framework: "@storybook/react",
  core: {
    builder: "storybook-builder-vite",
  },
  async viteConfig(config, { configType }) {
    return config;
  },
};

However, Webpack is still used, according to console output....

Version: webpack 4.46.0
Time: 7297ms
Built at: 02/18/2022 3:12:03 PM

Seeing this error on the client:

Uncaught SyntaxError: The requested module '/node_modules/jest-mock/build/index.js?v=9652e658' does not provide an export named 'fn'

And unable to view any stories.

This is with storybook-builder-vite:^0.1.16 and [email protected]

Any ideas? Thanks

@jamespantalones jamespantalones changed the title Storybook Still Using Webpack Despite adding builder option Storybook still using Webpack, despite adding correct builder option Feb 18, 2022
@IanVS
Copy link
Member

IanVS commented Feb 18, 2022

It looks like you are hitting storybookjs/storybook#17516, unfortunately.

As for webpack, it is indeed still used to build the manager portion of storybook (the sidebar and panels, etc). This builder is only responsible for the "preview" i.e. the iframe that your component renders into.

@jamespantalones
Copy link
Author

aha, yep, that was it. when i remove @storybook/addon-interactions it works. many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants