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 @@ -80,6 +80,19 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
8080 options . debug && logger . info ( 'Using default server init.' ) ;
8181 injectScript ( 'page-ssr' , buildServerSnippet ( options || { } ) ) ;
8282 }
83+
84+ // Prevent Sentry from being externalized for SSR.
85+ // Cloudflare like environments have Node.js APIs are available under `node:` prefix.
86+ // Ref: https://developers.cloudflare.com/workers/runtime-apis/nodejs/
87+ if ( config ?. adapter ?. name . startsWith ( '@astro/cloudflare' ) ) {
88+ updateConfig ( {
89+ vite : {
90+ ssr : {
91+ noExternal : [ '@sentry/astro' , '@sentry/node' ] ,
92+ } ,
93+ } ,
94+ } ) ;
95+ }
8396 }
8497
8598 const isSSR = config && ( config . output === 'server' || config . output === 'hybrid' ) ;
You can’t perform that action at this time.
0 commit comments