dubinc / dub

Open-source link management infrastructure. Loved by modern marketing teams like Vercel, Raycast, and Perplexity.
https://dub.co
GNU Affero General Public License v3.0
17.87k stars 1.89k forks source link

API and TypeErrors while building dub #1045

Closed Capeguy closed 2 months ago

Capeguy commented 3 months ago

Hi,

When checking out the latest commit in main@19b8327, running the command pnpm run build returns the following errors:



✓ Linting and checking validity of types    

⚠ Using edge runtime on a page currently disables static generation for that page

✓ Collecting page data    

Generating static pages (0/62)  [    ]
API error occurred Dynamic server usage: Route /api/analytics/demo couldn't be rendered statically because it accessed \`request.headers\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error

Using engine: planetscale.

Generating static pages (28/62)  [==  ]API error occurred Dynamic server usage: Route /api/me couldn't be rendered statically because it accessed \`request.headers\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error

Generating static pages (43/62)  [=== ]API error occurred Dynamic server usage: Route /api/support/upload couldn't be rendered statically because it accessed \`request.headers\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error

Generating static pages (47/62)  [ ===]TypeError: Cannot read properties of undefined (reading 'recurring_revenue')
    at p (/workspace/dub/apps/web/.next/server/app/admin.dub.co/revenue/page.js:1:6105)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  digest: '1171880323'
}
TypeError: Cannot read properties of undefined (reading 'recurring_revenue')
    at p (/workspace/dub/apps/web/.next/server/app/admin.dub.co/revenue/page.js:1:6105)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  digest: '1171880323'
}
TypeError: Cannot read properties of undefined (reading 'recurring_revenue')
    at p (/workspace/dub/apps/web/.next/server/app/admin.dub.co/revenue/page.js:1:6105)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  digest: '1171880323'
}

Error occurred prerendering page "/admin.dub.co/revenue". Read more: https://nextjs.org/docs/messages/prerender-error

TypeError: Cannot read properties of undefined (reading 'recurring_revenue')
    at p (/workspace/dub/apps/web/.next/server/app/admin.dub.co/revenue/page.js:1:6105)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
 ✓ Generating static pages (62/62)

> Export encountered errors on following paths:
        /admin.dub.co/revenue/page: /admin.dub.co/revenue
 ELIFECYCLE  Command failed with exit code 1.```

Please advise if this is a bug or what we should be running instead. Thanks!
linear[bot] commented 3 months ago

ENG-422 TypeErrors while building dub

steven-tey commented 2 months ago

@Capeguy thanks for the headsup here – this should've been fixed by #1040