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 => {
8181 options . debug && console . log ( '[sentry-astro] Using default server init.' ) ;
8282 injectScript ( 'page-ssr' , buildServerSnippet ( options || { } ) ) ;
8383 }
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+ }
8497 }
8598
8699 const isSSR = config && ( config . output === 'server' || config . output === 'hybrid' ) ;
You can’t perform that action at this time.
0 commit comments