Commit f870073
authored
fix(astro): Do not inject withSentry into Cloudflare Pages (#19558)
When running on Cloudflare Pages the `withSentry` function got bundled
and wrapped into the `index.js`. This actually didn't cause any problems
during the runtime, but it just added unnecessary code into the bundle.
This removes now the automatic wrapping, which is required for
Cloudflare Workers only.
By adding the plugin `sentryCloudflareNodeWarningPlugin` we also remove
tons of warnings like following when building for Cloudflare Pages:
```
11:20:40 [WARN] [vite] [plugin vite:resolve] Automatically externalized node built-in module "node:diagnostics_channel" imported from "node_modules/.pnpm/@sentry+node@10.40.0/node_modules/@sentry/node/build/esm/integrations/tracing/fastify/index.js". Consider adding it to environments.ssr.external if it is intended.
11:20:40 [WARN] [vite] [plugin vite:resolve] Automatically externalized node built-in module "node:diagnostics_channel" imported from "node_modules/.pnpm/@sentry+node-core@10.40.0_@opentelemetry+api@1.9.0_@opentelemetry+context-async-hooks@2_feb79575758996d9eeb93d3eb9a5534b/node_modules/@sentry/node-core/build/esm/integrations/http/httpServerIntegration.js". Consider adding it to environments.ssr.external if it is intended.
```
Closes #19559 (added automatically)1 parent 552187d commit f870073
File tree
2 files changed
+386
-2
lines changed- packages/astro
- src/integration
- test/integration
2 files changed
+386
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
195 | | - | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
258 | 295 | | |
259 | 296 | | |
260 | 297 | | |
| |||
0 commit comments