Dotfiles missing in Stackblitz projects initialized from GitHub
Describe the bug
Previously, I believe that initializing a new Stackblitz project from a URL ...
https://stackblitz.com/github/<user>/<repo>
... would include .env files, if they were checked into the repository (not in .gitignore). Testing some older examples now, that no longer works, and .env files are missing from the initialized Stackblitz project, causes startup to fail. For easier reproduction, I've created a minimal repository here:
https://github.com/donmccurdy/20241010-stackblitz-dotfiles
Link to the blitz that caused the error
https://stackblitz.com/github/donmccurdy/20241010-stackblitz-dotfiles
Steps to reproduce
- Go to https://stackblitz.com/github/donmccurdy/20241010-stackblitz-dotfiles
- Wait for output to the Stackblitz terminal
- Observe that
envloads, but.envis missing
Expected behavior
-
.env.localSHOULD be missing — it is in.gitignoreand was never pushed to GitHub -
.envSHOULD NOT be missing — it is in version control, and is visible on GitHub
Parity with Local
- [X] I have run the project in my local machine and I could not reproduce the issue.
Screenshots
Output:
Unable to read path ".env" [ENOENT: no such file or directory...
Unable to read path ".env.local" [ENOENT: no such file or directory...
{ env: 'OK=1' }
Platform
n/a
Additional context
I've filed an issue for the same problem at https://github.com/stackblitz/core/issues/3125, not sure which location is preferred in this case. Thanks!
Hey folks! Is there any movement on this topic? I'm building with vite and react, and the ability to import env variables via import.meta.env.VITE_MY_ENV_VAR is required to provide a comparable experience between Stackblitz and the cloned repo. Is this a topic that is going to be touched?
Same here... Is there someone who can take a look? 👀 😢