fix(vercel-analytics): skip script in dev to avoid failed insights POSTs#713
fix(vercel-analytics): skip script in dev to avoid failed insights POSTs#713
Conversation
Vercel Analytics collects via a relative `/_vercel/insights/*` endpoint served by Vercel's edge. Outside a Vercel deployment (including `nuxt dev`) there's no upstream, so the script POSTs to the local origin and 404s. Default to manual trigger in dev so the script only loads if explicitly triggered, and drop the unused `mode`/`debug` options that leaked the old debug-script path.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
📝 WalkthroughWalkthroughThis pull request refactors the Vercel Analytics integration by removing mode-based runtime switching and the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/content/docs/1.guides/2.first-party.md`:
- Line 353: The Vercel Analytics entry is classified inconsistently: update the
privacy-tier table so the Vercel Analytics row/entry (labelled "Vercel
Analytics" or path "/scripts/vercel-analytics") appears only under the
bundle-only/no-proxy category and remove or relocate it from the proxied IP-only
scripts list so both the table and the prose consistently state it is served via
Vercel edge and only works on Vercel (skipped in nuxt dev); ensure the single
canonical description is used in both places (the table row and any list that
previously included it).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 326e5356-ea54-4ab7-9491-f2a4a516d1d9
📒 Files selected for processing (10)
docs/content/docs/1.guides/2.first-party.mddocs/content/scripts/vercel-analytics.mdpackages/script/src/registry-types.jsonpackages/script/src/registry.tspackages/script/src/runtime/registry/schemas.tspackages/script/src/runtime/registry/vercel-analytics.tsplayground/pages/third-parties/vercel-analytics/nuxt-scripts.vuescripts/generate-sizes.tstest/e2e-dev/first-party.test.tstest/e2e/basic.test.ts
💤 Files with no reviewable changes (3)
- test/e2e/basic.test.ts
- playground/pages/third-parties/vercel-analytics/nuxt-scripts.vue
- packages/script/src/runtime/registry/schemas.ts
| | [Crisp](/scripts/crisp) | SDK loads secondary scripts and CSS at runtime from `client.crisp.chat`. | | ||
| | [Mixpanel](/scripts/mixpanel-analytics) | No proxy integration yet. | | ||
| | [Bing UET](/scripts/bing-uet) | No proxy integration yet. | | ||
| | [Vercel Analytics](/scripts/vercel-analytics) | Collects via relative `/_vercel/insights/*` served by Vercel's edge. Only works on Vercel-hosted deployments; skipped in `nuxt dev`. | |
There was a problem hiding this comment.
Resolve contradictory Vercel Analytics classification in this guide.
Line 353 says Vercel Analytics is bundle-only/no-proxy, but Line 66 still lists it under proxied IP-only scripts. Please align the privacy-tier table to avoid conflicting guidance.
📝 Proposed docs fix
-| **IP only** | IP addresses anonymised to subnet level | Plausible, PostHog, Umami, Fathom, CF Web Analytics, Vercel Analytics, Rybbit, Databuddy, Matomo, Intercom, YouTube, Vimeo, Gravatar, Carbon Ads, Lemon Squeezy, Google AdSense |
+| **IP only** | IP addresses anonymised to subnet level | Plausible, PostHog, Umami, Fathom, CF Web Analytics, Rybbit, Databuddy, Matomo, Intercom, YouTube, Vimeo, Gravatar, Carbon Ads, Lemon Squeezy, Google AdSense |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/content/docs/1.guides/2.first-party.md` at line 353, The Vercel
Analytics entry is classified inconsistently: update the privacy-tier table so
the Vercel Analytics row/entry (labelled "Vercel Analytics" or path
"/scripts/vercel-analytics") appears only under the bundle-only/no-proxy
category and remove or relocate it from the proxied IP-only scripts list so both
the table and the prose consistently state it is served via Vercel edge and only
works on Vercel (skipped in nuxt dev); ensure the single canonical description
is used in both places (the table row and any list that previously included it).
🔗 Linked issue
N/A
❓ Type of change
📚 Description
Vercel Analytics collects via a relative
/_vercel/insights/*endpoint served by Vercel's edge. Outside Vercel (includingnuxt dev) there is no upstream, so the bundled script POSTs to the local origin and 404s. Default the trigger tomanualin dev so the script only loads when explicitly triggered, and drop the unusedmode/debugoptions that leaked the old debug-script path. Docs call out the dev behaviour and the first-party table marks Vercel Analytics as bundle-only.