Repository navigation
Commit 475077b
fix(cloudflare): auto-instrument a re-exported default export
The Vite plugin did not wrap a Worker entry whose default export comes
from another module:
```js
export { default } from './handler';
export { handler as default } from './handler';
```
The transform now imports the handler under a private name, wraps it
with `withSentry`, and exports the wrapper as the default.
The handler may already be wrapped in its own module, which the build
cannot see. So the wrap goes through `_INTERNAL_wrapUnlessInstrumented`,
the same guard that class re-exports use. For a handler object, a second
`withSentry` call adds nothing anyway, because each method is patched
only once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent 1698a1d commit 475077b
2 files changed
Lines changed: 76 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
562 | 584 | | |
563 | 585 | | |
564 | 586 | | |
| |||
586 | 608 | | |
587 | 609 | | |
588 | 610 | | |
589 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
590 | 615 | | |
591 | 616 | | |
592 | 617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
228 | 268 | | |
229 | 269 | | |
230 | 270 | | |
| |||
1093 | 1133 | | |
1094 | 1134 | | |
1095 | 1135 | | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1096 | 1146 | | |
1097 | 1147 | | |
1098 | 1148 | | |
| |||
0 commit comments