question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: No .env.example in some templates

See original GitHub issue

Provide environment information

System: OS: macOS 12.0.1 CPU: (8) arm64 Apple M1 Memory: 92.91 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm

Describe the bug

I noticed when I generate a new project, an .env.example file is not always included. For example if you create a project and select either no additional packages or just trpc, you don’t get the example env file. Not sure if this is expected behaviour but i would assume there is always a potential use case for .env files regardless of which additional packages you install.
I realise that its super easy to create an env file but the docs refer to this example file and figured it would be nice to have across all template options.

To reproduce

Run npx create-t3-app, select all defaults except just select trpc in the additional packages section.

Additional information

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
c-ehrlichcommented, Nov 26, 2022

I don’t think we should introduce a prompt for everything. Ship a sensible default, and if people want the opposite they can create/delete the file.

0reactions
mtmeyercommented, Nov 26, 2022

I think there’s always a possibility you could need env vars regardless of the additional packages installed so I see no harm in adding an example. If no example is included then I think it might be worth mentioning it in the docs as that’s what confused me in the first place. An alternative could also be to just include an example in the docs for when someone goes looking for it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

template stanza doesn't load env as expected #6112 - GitHub
The workaround we went for to solve this is to add a check in the entrypoint of the container. If the envvar is...
Read more >
git ignore .env files not working - Stack Overflow
My git repository does not contain .env or .env.example, but it DOES contain .env.local and .env.staging. I've tried everything I can think ...
Read more >
env.template - Read the Docs
A utility tool to create .env files¶ ... dump-env takes an .env.template file and some optional environmental variables to create a new .env...
Read more >
Please don't commit .env - DEV Community ‍ ‍
Whenever we decide to use .env files to hide our precious API keys and passwords, we are always reminded to never commit the...
Read more >
Env Variables and Modes - Vite
For example, dynamic key access like import.meta.env[key] will not work. It will also replace these strings appearing in JavaScript strings and Vue templates....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found