import { ErrorContext } from '../errorReporting'; // A deliberate throw, reachable only from the dev server. Every mount site // guards it with `import.meta.env.DEV &&`, which Vite replaces with `false` in // a production build so Rollup drops both the element and this module. // // The marker is in the thrown message so a production bundle can be grepped for // it. A gate that is silently always-off looks identical to one that works, so // this is checked rather than trusted — the same reasoning as #61's coverage // instrumentation gate. export const DEV_THROW_MARKER = '__DEV_THROW_BOUNDARY__'; export default function DevThrow({ scope }: Readonly<{ scope: ErrorContext }>) { const requested = new URLSearchParams(window.location.search).get('boom'); if (requested === scope) { throw new Error(`${DEV_THROW_MARKER} deliberate throw in ${scope}`); } return null; }