diff --git a/ghost/admin/app/routes/application.js b/ghost/admin/app/routes/application.js index fbd6abdbb5..f97d76803c 100644 --- a/ghost/admin/app/routes/application.js +++ b/ghost/admin/app/routes/application.js @@ -184,11 +184,11 @@ export default Route.extend(ShortcutsRoute, { integrations: [ new RewriteFrames({ iteratee: (frame) => { - console.log('frame: ', frame); // eslint-disable-line no-console - console.log('cdnUrl: ', appConfig.cdnUrl); // eslint-disable-line no-console - // Remove duplicate `assets/` from CDN file paths (unsure why this occurs though) - if (frame.filename?.startsWith(appConfig.cdnUrl) && frame.filename?.includes('assets/assets/')) { - frame.filename = frame.filename.replace('assets/assets/', 'assets/'); + if (this.config.sentry_env === 'production') { + // Remove duplicate `assets/` from CDN file paths (unsure why this occurs though) + if (frame.filename?.startsWith(appConfig.cdnUrl) && frame.filename?.includes('assets/')) { + frame.filename = frame.filename.replace('assets/', ''); + } } return frame;