Skip to content

Commit

Permalink
Correctly check if global exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
emspishak committed Nov 15, 2024
1 parent c5ee13d commit 27b81ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/web/src/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ function injectSpeedInsights(
}
if (props.endpoint) {
script.dataset.endpoint = props.endpoint;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- process doesn't exist in all frameworks
} else if (process?.env?.[basepathVariableName]) {
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain, @typescript-eslint/no-unnecessary-condition -- process doesn't exist in all frameworks
} else if (
typeof process !== 'undefined' &&
process.env?.[basepathVariableName]
) {
script.dataset.endpoint = `/${process.env[basepathVariableName]}/_vercel/speed-insights/vitals`;
}
if (props.dsn) {
Expand Down

0 comments on commit 27b81ae

Please sign in to comment.