vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.97k stars 26.88k forks source link

next js collision in turborepo #59823

Open Nicolasvegam opened 10 months ago

Nicolasvegam commented 10 months ago

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

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

ImLunaHey commented 3 months ago

i have the same issue and im not using turbo repo.

Type error: Argument of type 'import("/home/runner/work/next-axiom/next-axiom/examples/logger/node_modules/next/dist/server/web/spec-extension/request").NextRequest' is not assignable to parameter of type 'import("/home/runner/work/next-axiom/next-axiom/node_modules/next/dist/server/web/spec-extension/request").NextRequest'. Property '[INTERNALS]' is missing in type 'import("/home/runner/work/next-axiom/next-axiom/examples/logger/node_modules/next/dist/server/web/spec-extension/request").NextRequest' but required in type 'import("/home/runner/work/next-axiom/next-axiom/node_modules/next/dist/server/web/spec-extension/request").NextRequest'.