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

[Bug]: @adminjs/bundler is overwriting NODE_ENV #1679

Open
AshotN opened this issue Jun 29, 2024 · 3 comments
Open

[Bug]: @adminjs/bundler is overwriting NODE_ENV #1679

AshotN opened this issue Jun 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@AshotN
Copy link
Contributor

AshotN commented Jun 29, 2024

Contact Details

No response

What happened?

If you import @adminjs/bundler

Your NODE_ENV gets set to production.

What is the point of that?

Bug prevalence

Always

AdminJS dependencies version

@adminjs/bundler v3.0.0

What browsers do you see the problem on?

No response

Relevant log output

No response

Relevant code that's giving you issues

https://github.com/SoftwareBrothers/adminjs-bundler/blob/main/src/bundle.ts#L6
@AshotN AshotN added the bug Something isn't working label Jun 29, 2024
@dziraf
Copy link
Contributor

dziraf commented Jun 29, 2024

There's no reason to use @adminjs/bundler locally but every AdminJS panel hosted remotely must have NODE_ENV set to production to bundle/serve minified files. It's set explicitly to production because there were lots of questions why people's admin panels load slowly in production or weigh over 50 MBs.

@AshotN
Copy link
Contributor Author

AshotN commented Jun 30, 2024

I have a staging environment, which acts the same as prod for most things. In that situation @adminjs/bundler changes my NODE_ENV and causes issues.

It shouldn't be a packages responsibility for the user to set the correct NODE_ENV. Nor should a package overwrite process.env

@AshotN
Copy link
Contributor Author

AshotN commented Jul 30, 2024

@dziraf is this something you'd be open to change if I created a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants