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

fix(react-email): Respect user NODE_ENV #1756

Merged
merged 4 commits into from
Jan 9, 2025
Merged

Conversation

AshotN
Copy link
Contributor

@AshotN AshotN commented Nov 1, 2024

7eb68af#diff-c5c5ee3ee563e33630e1ad83f07d66cb99b9be9a662fa8f4f9d7a6d43e98b7d0

This commit caused NODE_ENV to no longer be respected and always become development

This change will respect NODE_ENV and default to development if nothing is passed in.

Copy link

changeset-bot bot commented Nov 1, 2024

🦋 Changeset detected

Latest commit: 3719786

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-email Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 1, 2024

@AshotN is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@gabrielmfern
Copy link
Collaborator

I don't think we can give preference to the process.env like this since it'll always have NODE_ENV as production by default. What is your use case for this change? Maybe we can think of something better

it also seems to cause a type error

@gabrielmfern gabrielmfern force-pushed the canary branch 3 times, most recently from 0426d02 to 868acde Compare November 5, 2024 19:07
@AshotN
Copy link
Contributor Author

AshotN commented Nov 5, 2024

I was trying to deploy the preview site. I am using https://github.com/node-config/node-config to handle my ENV files.

Some of my email templates rely on variables from those env files. With react-email changing the NODE_ENV, I end up being unable to load the files.

@gabrielmfern
Copy link
Collaborator

@AshotN Got it, I tested it out a bit and your way works just fine in the situation that I was mentioning.

Have you tested this PR out to see if it fixes it in your case? What you can do to test it out is run pnpm build and then npm link in packages/react-email and then the email CLI is going to be using your local version.

@AshotN
Copy link
Contributor Author

AshotN commented Nov 12, 2024

To be honest, I have not tested it. It seemed like a simple change, but I will spend some time this week making sure.

@AshotN
Copy link
Contributor Author

AshotN commented Dec 17, 2024

@gabrielmfern Sorry for the lag on my response, I just tested it on my local and it does solve my problem. I caught the branch back up. If there is anything else you need from me, let me know. Thanks!

@gabrielmfern gabrielmfern force-pushed the canary branch 2 times, most recently from 4ee4d1d to 0187b0a Compare December 23, 2024 13:28
dependabot bot and others added 3 commits January 9, 2025 09:51
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@gabrielmfern gabrielmfern merged commit 1490bb5 into resend:canary Jan 9, 2025
5 of 7 checks passed
gabrielmfern added a commit that referenced this pull request Jan 9, 2025
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabriel miranda <[email protected]>
gabrielmfern added a commit that referenced this pull request Jan 9, 2025
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabriel miranda <[email protected]>
gabrielmfern added a commit that referenced this pull request Jan 13, 2025
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabriel miranda <[email protected]>
@AshotN AshotN deleted the patch-1 branch January 15, 2025 18:16
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

Successfully merging this pull request may close these issues.

2 participants