question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError: Maximum call stack size exceeded when seeding Prisma database

See original GitHub issue

Bug 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

  1. Run the "prisma": { "schema": "db/schema.prisma", "seed": "npm run db:seed" }, command
  2. 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wildkycommented, Sep 5, 2022

@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 😆

0reactions
janpiocommented, Nov 25, 2022

Closing then until someone provides more information. Please comment or open a new issue. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found