Open kamil-wsiiz opened 1 year ago
I am using MySQL and got the same error
https://github.com/yutakobayashidev/capitalens/commit/ac1c66db212f80b76459d4f9c39c72926da1a767
What exactly does that commit signify @yutakobayashidev - did you upgrade these dependencies - probably most important the TS version - and that led to a Server Component error to appear in your project?
Thanks for the nice reproduction steps, I could easily by following them:
PS C:\Users\Jan\Documents\throwaway\19715\my-app> npm run build
> my-app@0.1.0 build
> next build
- info Loaded env from C:\Users\Jan\Documents\throwaway\19715\my-app\.env
- info Creating an optimized production build
- info Compiled successfully
> Build error occurred
RangeError: Maximum call stack size exceeded
at couldContainTypeVariables (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65159:39)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65453:14)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11)
at inferFromTypes (C:\Users\Jan\Documents\throwaway\19715\my-app\node_modules\typescript\lib\typescript.js:65459:11) {
type: 'RangeError'
}
- info Linting and checking validity of types .
A temporary workaround might be to downgrade to the previous typescript
version: npm install typescript@5.0.4
PS C:\Users\Jan\Documents\throwaway\19715\my-app> npx next build
- info Loaded env from C:\Users\Jan\Documents\throwaway\19715\my-app\.env
- info Creating an optimized production build
- info Compiled successfully
- info Linting and checking validity of types
- info Collecting page data
- info Generating static pages (4/4)
- info Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 4.78 kB 82 kB
└ ○ /favicon.ico 0 B 0 B
+ First Load JS shared by all 77.3 kB
├ chunks/488-2398932694129a7b.js 24.9 kB
├ chunks/bce60fc1-49ee79ad31766ac6.js 50.5 kB
├ chunks/main-app-297b12279ce3dd6b.js 215 B
└ chunks/webpack-737972036df45a17.js 1.64 kB
Route (pages) Size First Load JS
─ ○ /404 181 B 74.7 kB
+ First Load JS shared by all 74.5 kB
├ chunks/framework-8883d1e9be70c3da.js 45.1 kB
├ chunks/main-66891548548be155.js 27.6 kB
├ chunks/pages/_app-b555d5e1eab47959.js 195 B
└ chunks/webpack-737972036df45a17.js 1.64 kB
○ (Static) automatically rendered as static HTML (uses no initial props)
@janpio Starting with typescript 5.1.3, it is no longer necessary to give @ts-expect-error to the server component. However, updating to 5.1.3 is causing the same error as this issue
Vercel Build log:
- info Linting and checking validity of types...
> Build error occurred
RangeError: Maximum call stack size exceeded
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65452:30)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11)
at inferFromTypes (/vercel/path0/frontend/node_modules/.pnpm/typescript@5.1.3/node_modules/typescript/lib/typescript.js:65459:11) {
type: 'RangeError'
}
ELIFECYCLE Command failed with exit code 1.
Error: Command "pnpm run build" exited with 1
BUILD_UTILS_SPAWN_1: Command "pnpm run build" exited with 1
Currently my project is downgrading a dependency to temporarily avoid the error.
We dug a bit deeper:
There are two related issues in the Typescript repo: https://github.com/microsoft/TypeScript/issues/54618 + https://github.com/microsoft/TypeScript/issues/54549 The second mentions that the 5.2.0-dev
version might already fix this, and indeed: 5.2.0-dev.20230605
is still broken, but 5.2.0-dev.20230606
works again.
5.2.0-dev.20230606
conflicts with eslint-config-next@13.4.4
when building in Vercel
npm ERR! code ERESOLVE
--
10:40:52.955 | npm ERR! ERESOLVE could not resolve
10:40:52.956 | npm ERR!
10:40:52.956 | npm ERR! While resolving: eslint-config-next@13.4.4
10:40:52.956 | npm ERR! Found: typescript@5.2.0-dev.20230606
10:40:52.956 | npm ERR! node_modules/typescript
10:40:52.957 | npm ERR! typescript@"5.2.0-dev.20230606" from the root project
10:40:52.957 | npm ERR!
10:40:52.957 | npm ERR! Could not resolve dependency:
10:40:52.957 | npm ERR! peerOptional typescript@">=3.3.1" from eslint-config-next@13.4.4
10:40:52.957 | npm ERR! node_modules/eslint-config-next
10:40:52.960 | npm ERR! eslint-config-next@"13.4.4" from the root project
10:40:52.960 | npm ERR!
10:40:52.960 | npm ERR! Conflicting peer dependency: typescript@5.1.3
10:40:52.960 | npm ERR! node_modules/typescript
10:40:52.960 | npm ERR! peerOptional typescript@">=3.3.1" from eslint-config-next@13.4.4
10:40:52.961 | npm ERR! node_modules/eslint-config-next
10:40:52.961 | npm ERR! eslint-config-next@"13.4.4" from the root project
Same with me.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-config-next@13.4.2
npm ERR! Found: typescript@5.2.0-dev.20230619
npm ERR! node_modules/typescript
npm ERR! dev typescript@"^5.2.0-dev.20230619" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@">=3.3.1" from eslint-config-next@13.4.2
npm ERR! node_modules/eslint-config-next
npm ERR! eslint-config-next@"^13.4.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript@5.1.3
npm ERR! node_modules/typescript
npm ERR! peerOptional typescript@">=3.3.1" from eslint-config-next@13.4.2
npm ERR! node_modules/eslint-config-next
npm ERR! eslint-config-next@"^13.4.2" 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.
@thanosoncode @phihungtf Optimally the TypeScript team releases a new patch version and you would switch to that instead of using the "dev" version.
Meanwhile, I think adding this in your package.json would unblock your projects
"overrides": {
"typescript": "5.2.0-dev.20230606"
},
Or alternatively adding --force
or --legacy-peer-deps
to npm i
like mentioned in the error message (Vercel docs to customize the command here).
A temporary workaround might be to downgrade to the previous
typescript
version:npm install typescript@5.0.4
PS C:\Users\Jan\Documents\throwaway\19715\my-app> npx next build - info Loaded env from C:\Users\Jan\Documents\throwaway\19715\my-app\.env - info Creating an optimized production build - info Compiled successfully - info Linting and checking validity of types - info Collecting page data - info Generating static pages (4/4) - info Finalizing page optimization Route (app) Size First Load JS ┌ ○ / 4.78 kB 82 kB └ ○ /favicon.ico 0 B 0 B + First Load JS shared by all 77.3 kB ├ chunks/488-2398932694129a7b.js 24.9 kB ├ chunks/bce60fc1-49ee79ad31766ac6.js 50.5 kB ├ chunks/main-app-297b12279ce3dd6b.js 215 B └ chunks/webpack-737972036df45a17.js 1.64 kB Route (pages) Size First Load JS ─ ○ /404 181 B 74.7 kB + First Load JS shared by all 74.5 kB ├ chunks/framework-8883d1e9be70c3da.js 45.1 kB ├ chunks/main-66891548548be155.js 27.6 kB ├ chunks/pages/_app-b555d5e1eab47959.js 195 B └ chunks/webpack-737972036df45a17.js 1.64 kB ○ (Static) automatically rendered as static HTML (uses no initial props)
This works for me
TypeScript 5.1.5 is available: https://github.com/microsoft/TypeScript/releases/tag/v5.1.5 Did anyone try it? Does it solve the issue?
I had this issue as well while testing with Typescript 5.1.3. I just upgraded to Typescript v5.1.6 and my code seems to run without issues again. I suggest you give it a try and see if it helps fixing your problem too.
I upgraded to v5.1.6 (the latest as per the npm package) not 5.1.5. Version 5.1.5 does not work, 5.1.6 does work.
I see same issue in typescript 5.1.6
@briankostar Could you provide a minimal reproduction?
I'm seeing the same issue, none of the mentioned workarounds alleviated the fault. For my code it was a very simple server action fetching data from mongodb via mongoose. If I remove the .populate function the page renders fine. I know it worked at some point because I saw the field in the console output. I'm using nodejs 20.5.0 via asdf. I'm also regularly getting out of memory errors despite having plenty available on the system. I noticed there's orphaned processes when that happens named next-render-worker-pages.
Just found the root cause for my code. The problem was that I was returning mongoose result objects, gotta call .lean() and the error goes away. Console still complains about it not being a plain object as the _id field is a mongo ObjectId type. In a similar working action I mapped over the lean results and set _id to name._id.toString() to eliminate the console warning about object type not being a POJO.
Thanks for your comments @jameslporter, but as you do not use Prisma but Mongoose this is not relevant to our problem. I hid them.
I'm observing the same error with "typescript": "^5.2.2"
building my next.js app:
> Build error occurred
RangeError: Maximum call stack size exceeded
at getTypeAtFlowBranchLabel (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67879:40)
at getTypeAtFlowNode (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67683:50)
at getTypeAtFlowBranchLabel (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67889:28)
at getTypeAtFlowNode (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67683:50)
at getTypeAtFlowBranchLabel (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67889:28)
at getTypeAtFlowNode (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67683:50)
at getTypeAtFlowBranchLabel (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67889:28)
at getTypeAtFlowNode (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67683:50)
at getTypeAtFlowCondition (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67831:26)
at getTypeAtFlowNode (/Users/vick/Work/Carfeine/intelligent-inventory/node_modules/typescript/lib/typescript.js:67675:20) {
type: 'RangeError'
}
To get it to build on Vercel, I had to make my build script set the stack-size to 5000.
Installing tailwind@5.2.2
solved the issue for me.
Installing
tailwind@5.2.2
solved the issue for me.
Tailwind or Typescript?
i face this errors while building
RangeError: Maximum call stack size exceeded
--
05:26:29.985 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:29.985 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:29.986 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:29.986 | at Array.forEach (<anonymous>)
05:26:29.986 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:29.987 | at Array.forEach (<anonymous>)
05:26:29.987 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:29.987 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:29.987 | at Array.forEach (<anonymous>)
05:26:29.988 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:29.988 |
05:26:29.988 | Error occurred prerendering page "/applications". Read more: https://nextjs.org/docs/messages/prerender-error
05:26:29.988 | RangeError: Maximum call stack size exceeded
05:26:29.989 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:29.989 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:29.989 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:29.989 | at Array.forEach (<anonymous>)
05:26:29.990 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:29.990 | at Array.forEach (<anonymous>)
05:26:29.990 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:29.990 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:29.990 | at Array.forEach (<anonymous>)
05:26:29.991 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.090 | RangeError: Maximum call stack size exceeded
05:26:31.090 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:31.090 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.090 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.091 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.091 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.091 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.091 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.091 |
05:26:31.091 | Error occurred prerendering page "/team". Read more: https://nextjs.org/docs/messages/prerender-error
05:26:31.091 | RangeError: Maximum call stack size exceeded
05:26:31.091 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:31.091 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.091 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.091 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.091 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.091 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.091 | at Array.forEach (<anonymous>)
05:26:31.093 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.112 | Generating static pages (6/9)
05:26:31.113 | RangeError: Maximum call stack size exceeded
05:26:31.113 | at P (/vercel/path0/.next/server/chunks/686.js:10:66098)
05:26:31.113 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.113 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.113 | at Array.forEach (<anonymous>)
05:26:31.113 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.113 | at Array.forEach (<anonymous>)
05:26:31.114 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.114 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.114 | at Array.forEach (<anonymous>)
05:26:31.114 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.114 |
05:26:31.114 | Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
05:26:31.114 | RangeError: Maximum call stack size exceeded
05:26:31.115 | at P (/vercel/path0/.next/server/chunks/686.js:10:66098)
05:26:31.115 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.115 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.115 | at Array.forEach (<anonymous>)
05:26:31.115 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.115 | at Array.forEach (<anonymous>)
05:26:31.115 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.116 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.116 | at Array.forEach (<anonymous>)
05:26:31.116 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.116 | RangeError: Maximum call stack size exceeded
05:26:31.116 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:31.116 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.116 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.117 | at Array.forEach (<anonymous>)
05:26:31.117 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.117 | at Array.forEach (<anonymous>)
05:26:31.117 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.117 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.117 | at Array.forEach (<anonymous>)
05:26:31.117 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:31.118 |
05:26:31.118 | Error occurred prerendering page "/application". Read more: https://nextjs.org/docs/messages/prerender-error
05:26:31.118 | RangeError: Maximum call stack size exceeded
05:26:31.118 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:31.118 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:31.118 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:31.118 | at Array.forEach (<anonymous>)
05:26:31.119 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:31.119 | at Array.forEach (<anonymous>)
05:26:31.119 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:31.119 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:31.119 | at Array.forEach (<anonymous>)
05:26:31.119 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:33.072 | RangeError: Maximum call stack size exceeded
05:26:33.072 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:33.072 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:33.072 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:33.073 | at Array.forEach (<anonymous>)
05:26:33.073 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:33.073 | at Array.forEach (<anonymous>)
05:26:33.073 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:33.073 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:33.073 | at Array.forEach (<anonymous>)
05:26:33.074 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
05:26:33.074 |
05:26:33.074 | Error occurred prerendering page "/edituser". Read more: https://nextjs.org/docs/messages/prerender-error
05:26:33.074 | RangeError: Maximum call stack size exceeded
05:26:33.075 | at P (/vercel/path0/.next/server/chunks/686.js:10:66480)
05:26:33.075 | at l (/vercel/path0/.next/server/chunks/686.js:10:61660)
05:26:33.075 | at /vercel/path0/.next/server/chunks/686.js:10:62861
05:26:33.075 | at Array.forEach (<anonymous>)
05:26:33.076 | at /vercel/path0/.next/server/chunks/686.js:10:62834
05:26:33.076 | at Array.forEach (<anonymous>)
05:26:33.076 | at a (/vercel/path0/.next/server/chunks/686.js:10:62654)
05:26:33.076 | at /vercel/path0/.next/server/chunks/686.js:10:62918
05:26:33.076 | at Array.forEach (<anonymous>)
05:26:33.076 | at l (/vercel/path0/.next/server/chunks/686.js:10:62611)
@yh919 Please open a new issue and provide the required information to be able to reproduce this.
This next13 drives me a lot of bugs
got the same thing, using typescript 5.1.6
only happening when I run the build
RangeError: Maximum call stack size exceeded
at P (3068-b5a399783fbcb1fd.js:5:30167)
at l (3068-b5a399783fbcb1fd.js:5:25358)
at 3068-b5a399783fbcb1fd.js:5:26559
at Array.forEach (<anonymous>)
at 3068-b5a399783fbcb1fd.js:5:26532
at Array.forEach (<anonymous>)
at a (3068-b5a399783fbcb1fd.js:5:26352)
at 3068-b5a399783fbcb1fd.js:5:26616
at Array.forEach (<anonymous>)
at l (3068-b5a399783fbcb1fd.js:5:26309)
RangeError: Maximum call stack size exceeded
19:07:47.104 | at RegExp.exec (<anonymous>)
19:07:47.105 | at create (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:18889)
19:07:47.105 | at create (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:18918)
19:07:47.105 | at parse.fastpaths (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:18997)
19:07:47.105 | at picomatch.makeRe (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:21635)
19:07:47.105 | at picomatch (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:19637)
19:07:47.105 | at /vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:19294
19:07:47.105 | at Array.map (<anonymous>)
19:07:47.106 | at picomatch (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:19286)
19:07:47.106 | at micromatch.isMatch (/vercel/path0/node_modules/.pnpm/next@14.0.3_@babel+core@7.23.5_react-dom@18.2.0_react@18.2.0_sass@1.69.5/node_modules/next/dist/compiled/micromatch/index.js:15:1090)
19:07:47.176 | ELIFECYCLE Command failed with exit code 1.
19:07:47.198 | Error: Command "pnpm run build" exited with 1
@EverettQuebral @zihadm654 Please open a new issue and provide the required information to be able to reproduce this.
@zihadm654 For example, we would need to know which version of TypeScript you are using.
If you can provide a reproduction repository, it would help a lot 🙌🏼
Note that this is a general TypeScript error, and it could be caused by Prisma or not and will depend on your specific codebase, please verify that this is actually triggered by Prisma Client and which version.
Still work with version "next": "13.5.7-canary.25"
@zihadm654 Hi! Did you find a solution for this error?
For me removing the package "sharp" from package.json resolved the issue.
@zihadm654 Hi! Did you find a solution for this error?
it was not related to prisma it was related to a function calling again and again that's why the error occur.
For me removing the package "sharp" from package.json resolved the issue.
Same with me, I removed sharp package and it started working fine.
in my case i was using persian-tools/persian-tools to convert number to word. commenting the section that i would use this library's methods to convert numbers to words, solved my problem.
Removing the Sharp package solved the problem for me. It seems that the Sharp package was causing conflicts or issues, and removing it resolved the issue.
Anyone commenting on this: Please make sure to mention if you also use prisma
and/or @prisma/client
in your project. If not, you are not really in the correct repository and we might just be able to close this issue as nothing is wrong with Prisma any more. Thank you!
Removing the Sharp package solved the problem for me. It seems that the Sharp package was causing conflicts or issues, and removing it resolved the issue.
confirmed!
I had the same problem since I tried to send via props drilling from a server component to a client component an object with the error "Maximux call stack exceed" and to me the solution was:
const ServerComponent = async ({ params }: Props) => {
const session = await getAuthSession()
if (!session?.user) return redirect('/')
const game = await getGame(params.gameId)
const gameParsed = JSON.parse(JSON.stringify(game))
return (
<ClientComponent game={gameParsed} />
)
}
export default const ClientComponent = ( { game } : Props ) =>
const { ...rest } = game
return (
// use the props here because your maximux exceed problem won't be exist anymore
)
CHEERS ! 🎄
Bug description
While using Prisma and Mongoose during the execution of "npm run build", I'm receiving an error even with the simplest possible schema creation code.
After several hours of searching for the problem in a larger project, I have established several facts:
Has anyone encountered a similar problem and can suggest how to solve it?
How to reproduce
npx create-next-app@latest
npm install prisma --save-dev
npm install @prisma/client mongoose
npx prisma init --datasource-provider sqlite
npx prisma generate
Create
lib/test.ts
file with a content (it is the example code that illustrates the problem):npm run build
Expected behavior
Error-free project build.
Prisma information
Environment & setup
Prisma Version