vercel / vercel/next.js

next js collision in turborepo

Open
#59,823 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Runtime
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/vercel-next-js-reproduction-template-pages-2cz5ks

To Reproduce
image

La propiedad "[INTERNALS]" falta en el tipo "import("/Users/nicolas/Desktop/testing/carvuk-monorepo-clients/node_modules/.pnpm/next@13.4.12_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/web/spec-extension/request").NextRequest", pero es obligatoria en el tipo "import("/Users/nicolas/Desktop/testing/carvuk-monorepo-clients/node_modules/.pnpm/next@14.0.1_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/web/spec-extension/request").NextRequest".

From the error I could see that is conflict with different versions of next js in the same monorepo (turborepo). This is the middleware for checking auth from supabase

Current vs. Expected behavior

Expected to not be wrong by typescript
Current is the other way around

Verify canary release
  • I verified that the issue exists in the latest Next.js canary release
Provide environment information
no able to run it in monorepo
Which area(s) are affected? (Select all that apply)

Middleware / Edge (API routes, runtime)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox reproduction and the Middleware / Edge area, focusing on the reported TypeScript collision between next@13.4.12 and next@14.0.1 in a monorepo. Reproduce the error if possible; done means the middleware type-checks without conflicting NextRequest definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, typescript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.