Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Running analytics in both App and Pages router.

Aperta
#194 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
next.js

Direzione di ricerca

Reproduce the failure in a project using both the App Router and Pages Router with Speed Insights and Analytics v2.0.0 on Next.js 16.1.6, importing from analytics/next; compare it with the working /react imports and inspect the reported next/dist/server/route-modules/pages/vendored/contexts/app-router-context dependency. Done means both routers can use the intended package entry point without the module-loading error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hey, we are running into issues with the speed-insights and analytics packages.
We are running both the pages and app router in the same project.

For the app router we can import both from the analytics/next package and everything works. When we do the same for the pages router we get the following error:

Error: Failed to load external module @vercel/speed-insights-bcbcb3a010496fd7/next: Error: Cannot find module 'next/dist/server/route-modules/pages/vendored/contexts/app-router-context'
Require stack:
- /var/task/node_modules/next/dist/client/components/navigation.js
    at Context.externalImport [as y] (.next/server/chunks/ssr/[turbopack]_runtime.js:518:15)
    at async (.next/server/chunks/ssr/[root-of-the-server]__7b0c281d._.js:1:54)

https://cleanshot.com/share/8vWvkr8q [blocked]

Both packages do work in our pages router if we import from the /react version.

SpeedInsights & Analytics are on v2.0.0
Next.js version is 16.1.6

Lingua principale
TypeScript
Stelle
518
Fork
54
Merge medio
6h 21m
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel/analytics

Tutte le issue di vercel/analytics

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.