From d1d227cda964e1879e9d1cd09137f285ac14b9cd Mon Sep 17 00:00:00 2001 From: Pavel Kozlov Date: Wed, 29 Jun 2022 13:46:01 +0100 Subject: [PATCH] replace String with JSON.stringify This is clearly a bug, because when I have value of sourceMaps in my config like ``` sourceMaps: urlPrefix: /var/task ``` It's serialized like `[object Object]` and that's what I see on environment variable in lambda configuration. I am not sure what this variables is needed for (is it needed at all?), but definitely it shouldn't look like that. Could it be that for other cases here we should replace `String(...)` with `JSON.stringify(...)`? --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 78e94a3..4778b4f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -261,7 +261,7 @@ export class SentryPlugin implements Plugin { setEnv && (process.env.SENTRY_AUTO_BREADCRUMBS = newDefinition.environment.SENTRY_AUTO_BREADCRUMBS); } if (typeof sentryConfig.sourceMaps !== "undefined") { - newDefinition.environment.SENTRY_SOURCEMAPS = String(sentryConfig.sourceMaps); + newDefinition.environment.SENTRY_SOURCEMAPS = JSON.stringify(sentryConfig.sourceMaps); setEnv && (process.env.SENTRY_SOURCEMAPS = newDefinition.environment.SENTRY_SOURCEMAPS); } if (typeof sentryConfig.filterLocal !== "undefined") {