-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(shared-utils): process?.env will not transform to env by transcompiler #4327
Conversation
🦋 Changeset detectedLatest commit: 0b66463 The changes in this PR will be included in the next version bump. This PR includes changesets to release 57 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes involve a modification to the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
@s524797336 is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @s524797336 could you add the error your getting? / Replicaton ? |
A compiler like Webpack automatically replaces process.env.NODE_ENV with a string, such as 'development'. However, if you write it as process?.env?.NODE_ENV, Webpack won’t be able to replace it. This results in the process variable being directly executed in the browser, which is not defined by code, causing an error to be thrown. |
@wingkwong please check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any repo that can show us how you configure or reproduce the issue?
UPD: ok i can reproduce it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.changeset/clever-teachers-live.md (1)
5-5
: Enhance the change description for better clarityThe current description "fix process is not defined" is too brief. Consider expanding it to better explain the issue and its resolution:
-fix process is not defined +fix: remove optional chaining from process.env to ensure proper transcompiler transformationThis helps other developers understand:
- What was changed (removal of optional chaining)
- Why it was changed (to ensure proper transcompiler transformation)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.changeset/clever-teachers-live.md
(1 hunks)
🔇 Additional comments (1)
.changeset/clever-teachers-live.md (1)
1-3
: LGTM on the patch version bump
The patch version bump is appropriate as this fixes a bug (process undefined error) without introducing breaking changes.
…piler (#4327) * Fix (console.ts): process?.env will not transform to env by transcompiler * chore(changeset): add changeset --------- Co-authored-by: WK Wong <wingkwong.code@gmail.com>
When
warn
message such as buttononClick
deprecated warn, throw error when there is no global process var, transcompiler will not transformprocess?.env
to env string with?
in it.📝 Description
The
warn
method cause page error becauseprocess
is not defined.⛳️ Current behavior (updates)
Page break render
🚀 New behavior
Page correct render
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Summary by CodeRabbit