builder-vite: Unable to load from fresh installation

Here is the package.json image The error image image I started the project using this and choosing the react option.

npm init @vitejs/app vite-react-app --template react && cd vite-react-app
npm install # or yarn
npx sb@next init --builder storybook-builder-vite && npm run storybook

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@olemarius

The pertinent section of my package.json is:

{
  // ...
  "devDependencies": {
    "@storybook/addon-a11y": "6.4.0-rc.6",
    "@storybook/addon-docs": "6.4.0-rc.6",
    "@storybook/addon-essentials": "6.4.0-rc.6",
    "@storybook/addon-links": "6.4.0-rc.6",
    "@storybook/react": "6.4.0-rc.6",
    "@vitejs/plugin-react": "^1.1.0",
    "storybook-builder-vite": "^0.1.9",
    "typescript": "^4.4.4",
    "vite": "^2.6.14"
  },
  "resolutions": {
    "@storybook/csf-tools": "6.4.0-rc.6",
    "@storybook/source-loader": "6.4.0-rc.6",
    "@storybook/core-events": "6.4.0-rc.6"
  }
}

I’ve tried both

  1. delete package-lock and node_modules
  2. npm install
  3. npx npm-force-resolutions
  4. npm install
  5. run storybook

and

  1. delete package-lock and node_modules
  2. npm install
  3. npx npm-force-resolutions
  4. run storybook

The IGNORED_EXCEPTION doesnt go away.

running npm-why ( https://github.com/amio/npm-why ) shows that all is the same version.

@shilman Also tried rc-7 now, can confirm it doesnt work either.

I think the issue others are facing is due to not including the second npm install. If anyone is looking to use npm-force-resolutions I’d advise reading the usage guide: https://www.npmjs.com/package/npm-force-resolutions

@olemarius

As a workaround, add the following to your package.json file:

{
  "resolutions": {
    "@storybook/core-event": "6.4.0-rc.5",
    "@storybook/csf-tools": "6.4.0-rc.5",
    "@storybook/source-loader": "6.4.0-rc.5"
  }
}

If you are using yarn just re-install: yarn install; it automatically handles the “resolutions” field. If you are using npm, run npx npm-force-resolutions (and again after any change to your dependencies.) and then run npm install

npx npm-force-resolutions
npm install

See https://github.com/eirslett/storybook-builder-vite/issues/161#issuecomment-976987545 below.

We’ll be releasing 6.4 final very soon (later this week? early next?) which should hopefully help with this issue!