Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

bug: Prevent calling isInternal when not in the browser #253

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

ryan953
Copy link
Member

@ryan953 ryan953 commented Oct 20, 2022

The only method that could really be called a) in a node env b) during setup is captureInternalException which calls down to isInternal.
So we need to make sure that isInternal is only accessing the window object if it exists.

lodash.debounce is also called, but that's isomorphic.

@ryan953 ryan953 requested a review from billyvg October 20, 2022 20:39
@billyvg billyvg changed the title bug: Prevent callign isInternal when not in the browser bug: Prevent calling isInternal when not in the browser Oct 20, 2022
@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 32.73 KB (+0.1% 🔺) 655 ms (+0.1% 🔺) 174 ms (+957.32% 🔺) 829 ms

@ryan953 ryan953 merged commit 02248a5 into main Oct 20, 2022
@ryan953 ryan953 deleted the ryan953/guard-isInternal-on-browser branch October 20, 2022 20:44
@ryan953 ryan953 mentioned this pull request Oct 20, 2022
@kachkaev
Copy link

Thanks for fixing this! Happy to test a new release in hashintel/hash#1232

@billyvg
Copy link
Member

billyvg commented Oct 21, 2022

@kachkaev Published 0.6.6!

mydea pushed a commit to getsentry/sentry-javascript that referenced this pull request Nov 23, 2022
…ntry-replay#253)

The only method that could really be called a) in a node env b) during
setup is `captureInternalException` which calls down to `isInternal`.
So we need to make sure that `isInternal` is only accessing the `window`
object if it exists.

`lodash.debounce`  is also called, but that's isomorphic.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants