We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8e2b61 commit d2e0465Copy full SHA for d2e0465
packages/astro/src/integration/index.ts
@@ -80,6 +80,19 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
80
options.debug && logger.info('Using default server init.');
81
injectScript('page-ssr', buildServerSnippet(options || {}));
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
+ }
96
97
98
const isSSR = config && (config.output === 'server' || config.output === 'hybrid');
0 commit comments