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

How to access .env with Wrangler 2 #166

Closed
jaymakes11 opened this issue May 24, 2022 · 2 comments
Closed

How to access .env with Wrangler 2 #166

jaymakes11 opened this issue May 24, 2022 · 2 comments

Comments

@jaymakes11
Copy link

I'm in the process of updating a Wrangler 1 project that uses Worktop next with Wrangler 2 and can't figure out how to access entries in my .env file.

Previously, I used miniflare and passed the --env flag. E.g.

miniflare --env '.env'

Wrangler 2 does not support Miniflare commands directly. Reading this, it seems that perhaps Worktop should be passing a second env argument to the handler but it's not. Any ideas?

@lukeed
Copy link
Owner

lukeed commented May 24, 2022

Hi there, worktop doesn’t interact with env files at all. That is entirely reliant upon wrangler and/or miniflare. That said, wrangler 2 should have (or soon have) restored .env file support: cloudflare/workers-sdk#882

hope that helps

@lukeed lukeed closed this as completed May 24, 2022
@jaymakes11
Copy link
Author

Ah, I see... very helpful. Thank you, @lukeed!

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

No branches or pull requests

2 participants