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.

Some eslint plugins crash without NODE_ENV

See original GitHub issue

Currently it’s impossible to use vscode-eslint with any plugin that needs NODE_ENV because there’s no way to define it.

The ideal solution would be to expose a eslint.nodeEnv setting, or a more generalized eslint.processEnv setting, so that users can define whatever environment variables are needed by their eslint plugins.

Example:

[eslint-import-resolver-babel-module] Error: Using babel-preset-razzle requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are “development”, “test”, and “production”. Instead, received: undefined.

This is essentially the same issue as #741, but for some reason, that issue was closed when a platform-dependent workaround was found (which didn’t address the underlying root cause). Clearly, defining NODE_ENV for the entire VS Code process is overkill and not really a viable solution, as doing so is likely to cause other problems.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
adriencacciacommented, Aug 28, 2020

Thanks a lot @mattlubner, I’m using eslint-import-resolver-babel-module also with a custom babel config that requires a custom NODE_ENV, so this feature will greatly improve my workflow 😄.

@dbaeumer, do you have an ETA for a new version of the extension containing this feature ?

Thanks again for all your work !

2reactions
dbaeumercommented, Jul 31, 2020

I merged the PR. Will look into a new version when we ship a new version of VS Code beginning of August.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-only-warn return all rules as warning but still has ...
All the rules are return as warning, but my application is still crashed. How to prevent error returned after all warning? This is...
Read more >
@sentry-internal/eslint-plugin-sdk | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Core Concepts - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
webpack fails while making a npm run-script build proccess
If I run npm start it works perfectly, but if I run npm run-script build or npm run build it crashes the webpack...
Read more >
Netlify deployment crashes because app.tsx fails to load all ...
The deployment fails because it can't find any page from app.tsx… ... PM: $ webpack --node-env production 12:39:07 PM: Failed to load ....
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