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 => {
80
80
options . debug && logger . info ( 'Using default server init.' ) ;
81
81
injectScript ( 'page-ssr' , buildServerSnippet ( options || { } ) ) ;
82
82
}
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
+ }
83
96
}
84
97
85
98
const isSSR = config && ( config . output === 'server' || config . output === 'hybrid' ) ;
You can’t perform that action at this time.
0 commit comments