Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError: Maximum call stack size exceeded ([email protected]) #197

Open
JohT opened this issue Dec 2, 2024 · 1 comment
Open

RangeError: Maximum call stack size exceeded ([email protected]) #197

JohT opened this issue Dec 2, 2024 · 1 comment

Comments

@JohT
Copy link
Contributor

JohT commented Dec 2, 2024

Hi 👋,

i ran into a stack overflow and was able to reproduce it. Below you can find the things I've found out so far. I'll let you know if there is anything else I can find.

Thank 🙏 you very much,
Johannes

How to reproduce it

  • mkdir reproduce-stack-error
  • cd reproduce-stack-error
  • git clone --branch [email protected] https://github.com/remix-run/react-router.git
  • cd react-router/packages/react-router
  • npx --yes --package @jqassistant/[email protected] jqa-ts-lce

Error message

RangeError: Maximum call stack size exceeded
    at Array.join (<anonymous>)
    at defaultPrepareStackTrace (node:internal/errors:109:36)
    at Function.ErrorPrepareStackTrace (node:internal/errors:162:10)
    at prepareStackTraceCallback (node:internal/errors:144:29)
    at getStackString (node:internal/util/inspect:1244:16)
    at formatError (node:internal/util/inspect:1373:15)
    at formatRaw (node:internal/util/inspect:989:14)
    at formatValue (node:internal/util/inspect:844:10)
    at inspect (node:internal/util/inspect:368:10)
    at formatWithOptionsInternal (node:internal/util/inspect:2307:40)
RangeError: Maximum call stack size exceeded
    at formatError (node:internal/util/inspect:1413:18)
    at formatRaw (node:internal/util/inspect:989:14)
    at formatValue (node:internal/util/inspect:844:10)
    at inspect (node:internal/util/inspect:368:10)
    at formatWithOptionsInternal (node:internal/util/inspect:2307:40)
    at formatWithOptions (node:internal/util/inspect:2169:10)
    at console.value (node:internal/console/constructor:340:14)
    at console.warn (node:internal/console/constructor:381:61)
    at parseType (/Users/johnny/.npm/_npx/a41cec6d520ad9ee/node_modules/@jqassistant/ts-lce/dist/src/core/processors/type.util)
    at /Users/johnny/.npm/_npx/a41cec6d520ad9ee/node_modules/@jqassistant/ts-lce/dist/src/core/processors/type.utils.js:390:70

Log file

react-router-stack-size-exceeded.log

@SebastianWendorf
Copy link
Contributor

This is a known problem. It has to do with indexed access types that recursively reference each other being resolved by the TypeChecker in a way that makes impossible for the current logic to discern between a nested a type and a type reference, hence leading to an infinite recursion.
We're currently investigating a viable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants