Skip to content
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: fix access to env var using VITE_ prefix in README.md #793

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

dandv
Copy link
Contributor

@dandv dandv commented Dec 4, 2024

Priority*

  • High: This PR needs to be merged first, before other tasks.
  • Medium: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

In my previous large PR I forgot to add the VITE_ prefix to accessing the env var via import.meta.env.

Reference

https://vite.dev/guide/env-and-mode#env-files

@dandv dandv requested a review from Jonghakseo as a code owner December 4, 2024 14:45
@dandv
Copy link
Contributor Author

dandv commented Dec 4, 2024

I haven't tested this super thoroughly, but it seems that adding an env var to .env requires restarting pnpm dev for the variable to be accessible via import.meta.env.VITE.... If that is indeed the case, it should be mentioned in that section.

Copy link
Owner

@Jonghakseo Jonghakseo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jonghakseo Jonghakseo merged commit c382eac into Jonghakseo:main Dec 5, 2024
8 checks passed
@dandv dandv deleted the patch-1 branch December 9, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants