File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/astro/src/integration Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,19 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
81
81
options . debug && console . log ( '[sentry-astro] Using default server init.' ) ;
82
82
injectScript ( 'page-ssr' , buildServerSnippet ( options || { } ) ) ;
83
83
}
84
+
85
+ // Prevent Sentry from being externalized for SSR.
86
+ // Cloudflare like environments have Node.js APIs are available under `node:` prefix.
87
+ // Ref: https://developers.cloudflare.com/workers/runtime-apis/nodejs/
88
+ if ( config ?. adapter ?. name . startsWith ( '@astro/cloudflare' ) ) {
89
+ updateConfig ( {
90
+ vite : {
91
+ ssr : {
92
+ noExternal : [ '@sentry/astro' , '@sentry/node' ] ,
93
+ } ,
94
+ } ,
95
+ } ) ;
96
+ }
84
97
}
85
98
86
99
const isSSR = config && ( config . output === 'server' || config . output === 'hybrid' ) ;
You can’t perform that action at this time.
0 commit comments