File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -573,6 +573,16 @@ export default defineNuxtModule<ModuleOptions>({
573573 const proxyHandlerPath = await resolvePath ( './runtime/server/proxy-handler' )
574574 addServerHandler ( { route : `${ proxyPrefix } /**` , handler : proxyHandlerPath } )
575575
576+ // In dev, sink Vercel Analytics insight POSTs to `/_vercel/insights/*` so
577+ // they don't 404. Vercel's edge serves this path in production; locally
578+ // there's no upstream, so we return 204 to keep the script happy.
579+ if ( nuxt . options . dev && config . registry ?. vercelAnalytics ) {
580+ addServerHandler ( {
581+ route : '/_vercel/insights/**' ,
582+ handler : await resolvePath ( './runtime/server/vercel-insights-sink' ) ,
583+ } )
584+ }
585+
576586 const composables = [
577587 'useScript' ,
578588 'useScriptEventPage' ,
Original file line number Diff line number Diff line change 1+ import { defineEventHandler , setResponseStatus } from 'h3'
2+
3+ export default defineEventHandler ( ( event ) => {
4+ setResponseStatus ( event , 204 )
5+ return null
6+ } )
You can’t perform that action at this time.
0 commit comments