Closed Richard87 closed 1 year ago
I'm getting this with Vercel and "@clerk/nextjs": "4.23.0", breaking the 50mb limit.
Hello @jonsherrard and @Richard87 , thanks for the report - are you using the Clerk authMiddleware
helper? authMiddleware
uses import { NextResponse } from 'next/server';
which caused next/og
to be bundled with the middleware code incorrectly by NextJS in the past.
We collaborated with the Vercel team and a fix for this was introduced with next@13.4.4-canary.13
. Can you upgrade to the latest next
version and let me know if you're still seeing the same?
Thanks for the quick turnaround!
Yes, I am using authMiddleware
:
import { authMiddleware } from "@clerk/nextjs";
export default authMiddleware({
publicRoutes: ["/(.*)"],
});
export const config = {
matcher: ["/((?!.*\\..*|_next).*)", "/", "/(api|trpc)(.*)"],
};
vercel build refuses to build with conflicting versions of Clerk and Next :/
cloudflare-test git:(master) ✗ npx vercel build
Vercel CLI 31.0.1
Warning: When using Next.js, it is recommended to place JavaScript Functions inside of the `pages/api` (provided by Next.js) directory instead of `api` (provided by Vercel). Other languages (Python, Go, etc) should still go in the `api` directory. Learn More: https://nextjs.org/docs/api-routes/introduction
WARNING: You should not upload the `.next` directory.
Installing dependencies...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @clerk/nextjs@4.23.0
npm ERR! Found: next@13.4.4-canary.13
npm ERR! node_modules/next
npm ERR! next@"13.4.4-canary.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@">=10" from @clerk/nextjs@4.23.0
npm ERR! node_modules/@clerk/nextjs
npm ERR! @clerk/nextjs@"^4.23.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: next@13.4.12
npm ERR! node_modules/next
npm ERR! peer next@">=10" from @clerk/nextjs@4.23.0
npm ERR! node_modules/@clerk/nextjs
npm ERR! @clerk/nextjs@"^4.23.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/richard/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/richard/.npm/_logs/2023-07-24T10_15_51_359Z-debug-0.log
Error: Command "npm install" exited with 1
Thanks! upgrading Nextjs did solve the issue! :)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Package + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Dependencies + versions
Provide a json with the dependencies used in your project (copy paste from yarn.lock / package-lock.json) or a github project / template that reproduces the issue.
*Include the @clerk/ packages and their versions!**
Example:
Browser/OS
Cloudflare Pages
Description
I have created a short repository her describing the issue: https://github.com/Richard87/cloudflare-test I first thought the issue was at Cloudflare, but they just found it to be an issue with Clerk: https://github.com/cloudflare/next-on-pages/issues/47#issuecomment-1646076080
If you run the command
npx @cloudflare/next-on-pages@1
you will notice a bunch of unneeded wasm files that are generated because of Clerk, which include alot of unneeded dependencies.Edit
Leaving the a quote from the issue tagged above from Cloudflare: