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.

No more env: browser?

See original GitHub issue

Did something change recently in the env configuration?

I just updated to the latest version in one project and I’m getting a lot of error 'document' is not defined no-undef.

This is resolved when I manually set the “browser” env in my config but I wonder why it’s not done automatically here instead, like it used to be.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
ljharbcommented, Aug 7, 2016

Our React runs in both the browser and node, and our app sets both envs to true in its top-level config.

The top-level app is the only thing that truly knows its own environment - node, browser, tests, amd, etc.

I’m not opposed to adding it back, but the more I think about it, the more I think it’s not a shareable config’s job to set them.

0reactions
tleunencommented, Aug 7, 2016

Agreed. Thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby, Environment variables not accessible in browser
According to the docs, Gatsby's default support enables putting env variables into the browser, while the dotenv method allows getting env ...
Read more >
Environment Variable visible in browser - Netlify Support Forums
I want to use netlify, so that I can deploy my app, without the keys being visible on the front end. While deploying,...
Read more >
Basic Features: Environment Variables - Next.js
Learn to add and access environment variables in your Next.js application. ... Expose environment variables to the browser by prefixing with NEXT_PUBLIC_ ...
Read more >
Environment Variables in Apache
The most basic way to set an environment variable in Apache is using the unconditional SetEnv directive. Variables may also be passed from...
Read more >
Env Variables and Modes - Vite
For example, dynamic key access like import.meta.env[key] will not work. ... While you can define more custom env variables in .env.[mode] files, you...
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