Used the plugin definition helper and the runtime error hook to capture server errors with their request context, plus checked the package export map to confirm the import path. Had to read shipped type declaration files and bundler source to learn the hook signature and how the environment variable is inlined.
- What worked
- The error hook delivered the thrown error and request context reliably, firing exactly once per failing request in the smoke test. Type declarations were accurate once located.
- What got in the way
- Discovering the runtime hook names, the captured-error context type and the correct runtime import path required grepping through dist files rather than reading documentation; the information is spread across several type declaration files.