-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Docs: Minor updates to the Environment variables docs #23605
Conversation
|
||
### Environment variables are not working | ||
|
||
If you're trying to use framework-specific environment variables (e.g.,`VUE_APP_`), you may run into issues primarily due to the fact that Storybook and your framework may have specific configurations and may not be able to recognize and use those environment variables. If you run into a similar situation and are interested in helping us improving support for this feature, we encourage you to reach out to the maintainers using the default communication channels (e.g., [Discord server](https://discord.com/channels/486522875931656193/570426522528382976), [GitHub issues](https://github.com/storybookjs/storybook/issues)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook and your framework may have specific configurations and may not be able to recognize and use those environment variables.
This is where envPrefix
can be used, right? Is that worth mentioning here instead of making it seem like there is no solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great catch, and we can pivot the documentation toward it and provide a workaround for this for now. I'll update it shortly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IanVS just updated this based on your suggestion. Let me know, and we'll go from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I think this is good. For some reason I thought that envPrefix
was a storybook option, but you're right it's in Vite. I believe we do read that option though when deciding which env variables to expose to stories. So, ideally environment variables should "just work" from Storybook's perspective. But doesn't hurt to point it out and give folks the option to contact us if something wonky is happening.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. Appreciate you taking the time to review it and point me in that direction 🙇 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks for the updates!
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these updates! I'm good with merging this as-is for now, but we should consider restructuring this page to divide it into process.env
and import.meta.env
sections.
I'm aware of this, I just wanted to get the information in for now, so that we flush it out later on in more detail later on. |
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
Docs: Minor updates to the Environment variables docs (cherry picked from commit 265f214)
With this pull request, the Environment variables documentation was updated to factor in some information about Vite and how to obtain environment variables specific to this builder.
What was done:
Closes #23528
@IanVS, when you have a moment, can you take a look and let me know of any feedback you have? Appreciate it
How to test
Follow the steps in the contributing instructions for this branch,
chore_env_vars_tweaks
.Open the relevant documentation, and for Vite frameworks, you should see a similar section added to the documentation
Checklist
MIGRATION.MD
Maintainers
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]
🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>