-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support Storybook #3794
Comments
This is where bun is missing: The undertaking is somewhat similar to the Nest.js work |
Also having issues with storybook and bun When I run With
One with zlib / brotli
And one with module (seems related to this function in storybook code
|
Would love to get support for that and to be able to run tests based on composeStories API! |
Now the storybook can be initialized with : But when trying to run it: ^
TypeError: import_node_zlib.default.createBrotliDecompress is not a function. (In 'import_node_zlib.default.createBrotliDecompress()', 'import_node_zlib.default.createBrotliDecompress' is undefined)
at /Users/admin/repos/storybook-test/vite-project/node_modules/@storybook/core-server/dist/index.js:113:35958
at node:http:862:28
at processTicksAndRejections (:55:76)
ERR! TypeError: undefined is not an object (evaluating 'require("module")._extensions[".ts"]')
|
I've encountered the missing Module._extensions when trying to use bun to run an existing Jest unit test suite, which would be a huge win until the bun test runner supports all the main Jest features (and until teams find the time to port their code). It is one of several Node.js Module internals that are being used by multiple packages. I've also encountered the use of Module._preloadModules in ts-node. The "public API" of Should we create a new issue to track this? |
I was writing a tutorial about Bun + Storybook + Vite React App yesterda. Seems v1.0.3 works with |
I was having same error as @birkskyum Updated to 1.0.4 and now |
bun 1.0.16 This is what I get:
|
@birkskyum I got the same error. I try the versions that working above and using storybook version before the comment date to see if I can reproduce the working one, but all I got, is a the same I'm using Apple chip, arm64. Maybe, from now on, we should write a specific version and tell the platform env etc. |
Running Storybook using bun is not an issue, while running
|
Is this still an issue on latest Bun? I'm unable to reproduce. |
checked just now, and i still experience this on an apple silicon mac bun revision 1.0.23+83f2432da |
Same here on apple silicon using latest Bun stable release.
Current version:
|
Do you have node installed? The storybook init script is looking for a package manager, but can't find one as it only considers npm, pnpm and yarn. |
Tried again now that storybook 8 is out (same result for react and solid): bun 1.1.8-canary.1+3c082012b ➜ bun --bun run dev
$ vite
VITE v5.2.11 ready in 626 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
^C
repos/bun-kitchensink/storybook-test via 🍞 v1.1.8 via 🅒 base took 7.5s
➜ bun --bun x storybook@latest init
╭───────────────────────────────────────────────────────╮
│ │
│ Adding Storybook version 8.0.10 to your project.. │
│ │
╰───────────────────────────────────────────────────────╯
• Detecting project type. ✓
Installing dependencies...
up to date, audited 85 packages in 736ms
9 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
• Adding Storybook support to your "SolidJS" app
✔ Getting the correct version of 9 packages
✔ Installing Storybook dependencies
Error: Invariant failed
at invariant (/private/tmp/bunx-501-storybook@latest/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:13:25)
at <anonymous> (/private/tmp/bunx-501-storybook@latest/node_modules/@storybook/cli/dist/generate.js:59:11578)
at getRendererDir (/private/tmp/bunx-501-storybook@latest/node_modules/@storybook/cli/dist/generate.js:59:11157)
at <anonymous> (/private/tmp/bunx-501-storybook@latest/node_modules/@storybook/cli/dist/generate.js:61:3078)
at templatePath (/private/tmp/bunx-501-storybook@latest/node_modules/@storybook/cli/dist/generate.js:61:2749)
at <anonymous> (/private/tmp/bunx-501-storybook@latest/node_modules/@storybook/cli/dist/generate.js:61:3943)
at processTicksAndRejections (:12:39)
attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL: And running it (works without the --bun)
|
Is someone interested in supporting Bun's package manager? I have created an issue in Storybook's Monorepo: storybookjs/storybook#28164 The Storybook Core Team has not planned to work on it in the next months, so this work has to be community-driven. Though, I would like to support and give guidance as much as I can. |
Storybook - Website - GitHub
What version of Bun is running?
0.7.0
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
First create the Vite project.
bun x create-vite@latest
cd vite-project
bun i
bun --bun run dev
(Check that the Vite + Solid project runs as expected)Second init the storybook:
bun --bun x storybook@latest init
What is the expected behavior?
This is the case if ran just as
bun x storybook@latest init
without the--bun
flag.What do you see instead?
Additional information
It seems like this is a clue:
TypeError: process.binding() is not supported in Bun. If that breaks something, please file an issue and include a reproducible code sample.
But also that Storybook searched for one of
error: Unable to find a usable package manager within NPM, PNPM, Yarn and Yarn 2
but isn't satisfied with Bun as a package manager.Related links:
process.binding
uv
/natives
/config
+ make global object properties lazy #5355The text was updated successfully, but these errors were encountered: