RangeError: Maximum call stack size exceeded when seeding Prisma database
See original GitHub issueBug description
When running the "db:seed": "NODE_ENV=test NODE_PATH='.' dotenv -e .env.local -- ts-node-dev db/seeds/seed.ts",
I keep getting a RangeError: Maximum call stack size exceeded
error.
Tried downgrading TypeScript, node and ts-node. Unfortunately this didn’t help.
How to reproduce
- Run the
"prisma": { "schema": "db/schema.prisma", "seed": "npm run db:seed" },
command - Get error:
/node_modules/typescript/lib/typescript.js:68629 invokeOnce(source, target, inferFromObjectTypes); ^ RangeError: Maximum call stack size exceeded at inferFromTypes (/node_modules/typescript/lib/typescript.js:68629:25) at inferFromTypes (/node_modules/typescript/lib/typescript.js:68449:25) at inferFromTypes (/node_modules/typescript/lib/typescript.js:68449:25) at inferFromProperties (/node_modules/typescript/lib/typescript.js:68992:25) at inferFromObjectTypes (/node_modules/typescript/lib/typescript.js:68980:21) at invokeOnce (/node_modules/typescript/lib/typescript.js:68661:21) at inferFromTypes (node_modules/typescript/lib/typescript.js:68629:25) at inferFromTypes (/node_modules/typescript/lib/typescript.js:68449:25) at inferFromProperties (/node_modules/typescript/lib/typescript.js:68992:25) at inferFromObjectTypes (/node_modules/typescript/lib/typescript.js:68980:21)
Expected behavior
Running the db:seed command without errors.
Prisma information
Error seems to occur in this model. When removing relations with PackageStep
, PackageTranslation
, editedBy
and createdBy
the error was gone. But this is obviously not a feasible solution.
id Int @id @default(autoincrement())
uuid String @unique @default(uuid())
data String? @db.LongText
status Status @relation(fields: [statusId], references: [id])
statusId Int @map("mrb_sys_status_id")
companyProduct CompanyProduct @relation(fields: [companyProductId], references: [id])
companyProductId Int @map("mrb_sys_company_product_id")
createdAt DateTime @default(now()) @map("created")
editedAt DateTime @updatedAt @map("edited")
createdById Int @map("created_by_id")
createdBy User @relation(name: "createdPackages", fields: [createdById], references: [id])
editedById Int @map("edited_by_id")
editedBy User @relation(name: "editedPackages", fields: [editedById], references: [id])
cartItems CartItem[] @relation("package")
campaigns CampaignPackage[]
calendarEventLinks CalendarEventLink[]
media Media[]
translations PackageTranslation[]
steps PackageStep[]
@@map("mrb_module_package")
}
Environment & setup
- OS: macOS 12.4
- Database: MySQL 5.6.51
- Node.js version: 16.13.0
Prisma Version
3.14.0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
RangeError: Maximum call stack size exceeded - Prisma 1
Hi All, When I'm compiling my relay mutation I'm getting error from relay-compiler: RangeError: Maximum call stack size exceeded.
Read more >Maximum call stack size exceeded error while using .save ...
when I run this file, it says "RangeError: Maximum call stack size exceeded". The frustrating part is that I have another seeder file...
Read more >[Solved]-Call stack variables in javascript-node.js
Coding example for the question Call stack variables in javascript-node.js. ... RangeError: Maximum call stack size exceeded in nodejs and reactjs ...
Read more >npm ERR! Maximum call stack size exceeded Code Example
react js Uncaught RangeError: Maximum call stack size exceeded. javascript by Anxious Alligator · Anxious Alligator on Feb 06 2022 Comments(2). 10.
Read more >Highlights - FeedsAnywhere
Introspecting databases that organize objects in multiple database schemas ... prisma@4.7.1 - "RangeError: Maximum call stack size exceeded" when ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SevInf Gotcha – the latest comment (from just a few hours ago) in #9372 seems to infer it is not the prisma engine, but tsc compiler, so maybe they are the same issue after all 😆
Closing then until someone provides more information. Please comment or open a new issue. Thanks!