Skip to content

Commit

Permalink
Make access defensive.
Browse files Browse the repository at this point in the history
`process` may not exist in all frameworks, this ensures things will continue to work as expected.
  • Loading branch information
emspishak committed Nov 14, 2024
1 parent 68d0d13 commit 8f19080
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web/src/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ function inject(
}
if (props.endpoint) {
script.dataset.endpoint = props.endpoint;
} else if (process.env[basepathVariableName]) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- process doesn't exist in all frameworks
} else if (process?.env?.[basepathVariableName]) {
script.dataset.endpoint = `/${process.env[basepathVariableName]}/_vercel/insights`;
}
if (props.dsn) {
Expand Down

0 comments on commit 8f19080

Please sign in to comment.