Skip to content

Memory Leak / Infinite Recursion. TS hangs, TSC never finishes, VSCode and Intellisense dies.  #56081

Open

Description

🔎 Search Terms

Typescript Hangs, Memory Leak, VS Code, Prisma, React-Hook-Form,

🕗 Version & Regression Information

  • This is a crash

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about hanging.

Tested on latest 5.2.2 and 5.3.0-dev-20231012. typescript@next

⏯ Playground Link

https://codesandbox.io/p/sandbox/musing-turing-78vp6j?file=%2Fapp%2Fpage.tsx%3A6%2C33

💻 Code

import { useForm } from "react-hook-form";
import { Prisma } from "@prisma/client";

export default function Home() {
  const form = useForm<Prisma.UserCreateInput>();
  ...

This will hang everything. Typescript won't tsc and intellisense will just sit with "loading" no matter what you hover.

meanwhile this works fine:

import { useForm } from "react-hook-form";
import { Prisma } from "@prisma/client";

export default function Home() {
  const form = useForm<>();
  ...

tsc --noEmit --extendedDiagnostics will complete in like 3 seconds with this.

🙁 Actual behavior

Typescript won't complete a tsc --noEmit and intellisense will just sit with "loading" no matter what you hover over. I have seen it once before just set everything to any

With the generated types in the first example - i let it run for 1 hour 59mins on a M1 mac and no output.

You can see the full code example with a minimal repro on the codesandbox link. It also hangs it's intellisense in CSB and won't tsc.
CPU also goes to 100% on both local and CSB

🙂 Expected behavior

Doesn't hang typescript, operates just like if you put any other type in there say

type SomeType = {name: string} 
const form = useForm<SomeType>() 

Additional information about the issue

Another report by someone else here:

https://stackoverflow.com/questions/76932600/high-cpu-usage-when-using-some-prisma-types-with-react-hook-form

It seems to be anything that comes off the Prisma.* types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions