Skip to content

Commit

Permalink
Add process versions check
Browse files Browse the repository at this point in the history
  • Loading branch information
nunofgs committed Dec 21, 2023
1 parent 424abfd commit af7f255
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/node/src/plugins/customerio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ function normalizeEvent(ctx: Context) {
ctx.updateEvent('context.library.version', version)
const runtime = detectRuntime()
if (runtime === 'node') {
// eslint-disable-next-line no-restricted-globals
ctx.updateEvent('_metadata.nodeVersion', process.version)
// extra guard here was important for vercel edge.
if (typeof process.versions === 'object') {
ctx.updateEvent('_metadata.nodeVersion', process.versions.node)
}
}
ctx.updateEvent('_metadata.jsRuntime', runtime)
}
Expand Down

0 comments on commit af7f255

Please sign in to comment.