solidjs icon indicating copy to clipboard operation
solidjs copied to clipboard

[Bug] Impossible to run storybook with latest update

Open qlaffont opened this issue 1 year ago • 8 comments

Describe the bug

I have try to upgrade to latest version of storybook but it doesn't work

=> Failed to build the preview
Error: Missing "./internal/preview/runtime" specifier in "storybook" package
    at e (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:25)
    at n (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:631)
    at o (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:1301)
    at resolveExportsOrImports (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16481:18)
    at resolveDeepImport (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16494:25)
    at tryNodeResolve (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16324:18)
    at ResolveIdContext.resolveId (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16109:19)
    at EnvironmentPluginContainer.resolveId (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47137:17)
    at async resolve (file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47678:12)
    at async file://./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47694:22

Steps to reproduce

  1. Create Solid Start App
  2. Add storybook

Environment

Image

qlaffont avatar Dec 23 '24 14:12 qlaffont

I have the same problem (pnpm 9.15.1 with workspaces, vite 6.0.5)

> storybook dev -p 6006

@storybook/core v8.4.7

info => Starting manager..
info => Starting preview..
=> Failed to build the preview
Error: Missing "./internal/preview/runtime" specifier in "storybook" package
    at e (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:25)
    at n (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:631)
    at o (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:15283:1301)
    at resolveExportsOrImports (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16481:18)
    at resolveDeepImport (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16494:25)
    at tryNodeResolve (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16324:18)
    at ResolveIdContext.resolveId (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:16109:19)
    at EnvironmentPluginContainer.resolveId (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47137:17)
    at async resolve (file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47678:12)
    at async file:///D:/projects/apps/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-BZMjGe_U.js:47694:22

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

SinnerAir avatar Dec 24 '24 09:12 SinnerAir

I want to share a temporary solution. I visited the site https://new-storybook.netlify.app/, where I followed the link to the demo version for SolidJS. I updated the package.json

    "@storybook/addon-essentials": "^8.5.0-beta.5",
    "@storybook/addon-interactions": "^8.5.0-beta.5",
    "@storybook/blocks": "^8.5.0-beta.5",
    "@storybook/test": "^8.5.0-beta.5",
    "storybook": "^8.5.0-beta.5",

and the error was corrected

SinnerAir avatar Dec 24 '24 12:12 SinnerAir

package.json add

  "pnpm": {
    "overrides": {
      "@storybook/builder-vite": "~8.4.6"
    }
  }

yefu24324 avatar Jan 07 '25 10:01 yefu24324

The error occurs because the dependency @storybook/builder-vite@next was installed, resulting in the non-stable version 5.0.0-beta. This library is not yet compatible.

https://github.com/storybookjs/solidjs/blob/12e463340765704d87170a85afaf03a8af1ce71a/packages/frameworks/solid-vite/package.json#L53

If you are using pnpm, you can try

  "pnpm": {
    "overrides": {
      "@storybook/builder-vite": "~8.4.6"
    }
  }

yefu24324 avatar Jan 07 '25 10:01 yefu24324

I had installed storybook where some dependencies had a version with the ^ sign.

"@storybook/addon-essentials": "8.4.7",
    "@storybook/addon-interactions": "^8.4.7",
    "@storybook/builder-vite": "^8.4.7",
    "@storybook/core-server": "8.4.7",
    "@storybook/experimental-nextjs-vite": "^8.4.7",
    "@storybook/jest": "^0.2.3",
    "@storybook/nextjs": "8.4.7",
    "@storybook/react": "^8.4.7",
    "@storybook/react-vite": "^8.4.7",
    "@storybook/test": "^8.4.7",

When running npm install, some of these deps stayed on "8.4.7", while other were updated to the latest patch version. This caused issues where the error message was Error: Missing "./internal/preview/runtime" specifier in "storybook" package.

I fixed it with help of this issue and deleted node_modules, package-lock.json and setting all the packages in the package.json file to the same and fixed version:

"@storybook/addon-essentials": "8.4.7",
    "@storybook/addon-interactions": "8.4.7",
    "@storybook/builder-vite": "8.4.7",
    "@storybook/core-server": "8.4.7",
    "@storybook/experimental-nextjs-vite": "8.4.7",
    "@storybook/jest": "0.2.3",
    "@storybook/nextjs": "8.4.7",
    "@storybook/react": "8.4.7",
    "@storybook/react-vite": "8.4.7",
    "@storybook/test": "8.4.7",

DHFW avatar Feb 05 '25 10:02 DHFW

You can try using create-solid-storybook. I hope it may help.

kachurun avatar May 25 '25 20:05 kachurun

You can try using create-solid-storybook. I hope it may help.

This fixed all my issues, thx you ❤

alemesa avatar May 28 '25 18:05 alemesa

@alemesa

The Storybook team just dropped the stable 9.0 release, so my package should be updated as well. I've done this, and you can install the latest version with Storybook 9 support. However, I will update it once more today because it needs some tidying up due to deprecated packages in Storybook 9. So if you're on version 8 right now, it might be better to update ~tomorrow.

kachurun avatar May 28 '25 21:05 kachurun