-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Bug]: sb7+vite env variables not working inside addons #20675
Comments
Where are you setting the |
I think this isn't related to Vite, since it's an addon and being rendered in the manager. @ndelangen is this maybe a consequence of changing the manager over from Webpack to esbuild? I see that |
Right.. so the builder-manager needs to be modified to setup injecting environment variables into addons-bundles. Likely to be implemented here: storybook/code/lib/builder-manager/src/index.ts Lines 77 to 83 in e7c7462
|
fix #20675 by adding an esbuild plugin to inject env variables
Not released yet, was closed accidentally from PR title. |
@IanVS @vanessayuenn @shilman we're using the auto close feature nowadays, correct? |
Yes. @IanVS We're experimenting with using GH's PR-issue linkage feature so that our workflow is more standard |
Crikey!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.39 containing PR #20834 that references this issue. Upgrade today to the
|
It works, thx! |
Describe the bug
Environment variables are not available inside addon.
This is a repo to reproduce the error: node16 + sb7 + vite + npm
https://github.com/Luk-z/vite_ts_sb7_npm
This is a repo where the env variables works inside addons: node14 + sb6 + vite + npm
https://github.com/Luk-z/vite_ts_sb6_npm
To write the simple addon i followed https://storybook.js.org/docs/react/addons/writing-addons.
I'm expecting env variables are available inside an addon.
To Reproduce
System
Additional context
No response
The text was updated successfully, but these errors were encountered: