Conversation
…re it is not available
Lms24
reviewed
Oct 27, 2023
Member
There was a problem hiding this comment.
isBrowser is used in Replay:
sentry-javascript/packages/replay/src/integration.ts
Lines 215 to 217 in 6d9a766
Do you see another way how we could keep such a check but avoid accessing process or other APIs? I'm not totally opposed to deprecating/eventually removing this function but I can see such a check being useful for full stack/SSR frameworks or stuff like electron/cordova/capacitor...
Contributor
Author
@Lms24 Dang how could I miss that... I guess I'll undeprecate it? The GLOBAL_OBJ thing still works in the case of Next.js. |
AbhiPrasad
approved these changes
Oct 27, 2023
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
isBrowserfunctionis not used anywhere butaccessesprocessand makes Next.js print a warning sinceprocessis not available in the Edge runtime.This PR deprecates the function (because it is unused) and usesglobal.processinstead which seems to outsmart Next.js' static code analyzer.Also added tests to prevent stuff like this in the future: #9382