I get a strange compiler error. It states: RangeError: Value undefined out of range for undefined options property undefined
.
My feeling so far is, that the compiler runs internally into a loop and fills up a Map
until it is full. My best guess is, that this is connected to some faulty type declaration in our own code base.
My problem is, that the compiler is not telling which part of my code base is the issue for this problem and happened after a package update. So I don't see any hint which specific part of our code base is the root cause for this. How can I convince TypeScript to tell me this?
The whole stack trace looks like this:
$ yarn tscyarn run v1.22.4$ /myProject/app/node_modules/.bin/tsc/myProject/app/node_modules/typescript/lib/tsc.js:90679 throw e; ^RangeError: Value undefined out of range for undefined options property undefined at Map.set (<anonymous>) at recursiveTypeRelatedTo (/myProject/app/node_modules/typescript/lib/tsc.js:50962:30) at isRelatedTo (/myProject/app/node_modules/typescript/lib/tsc.js:50543:34) at checkTypeRelatedTo (/myProject/app/node_modules/typescript/lib/tsc.js:50229:26) at isTypeRelatedTo (/myProject/app/node_modules/typescript/lib/tsc.js:50192:24) at isTypeSubtypeOf (/myProject/app/node_modules/typescript/lib/tsc.js:49480:20) at /myProject/app/node_modules/typescript/lib/tsc.js:47289:90 at Object.some (/myProject/app/node_modules/typescript/lib/tsc.js:658:25) at _loop_14 (/myProject/app/node_modules/typescript/lib/tsc.js:47289:45) at removeStringLiteralsMatchedByTemplateLiterals (/myProject/app/node_modules/typescript/lib/tsc.js:47294:21)error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Background
This happened after I upgraded react-hook-form from version 6 to 7, with no other changes to the code base.
I tried already the following (all with the same outcome):
- Updating TypeScript to the newest 4.3.X version
- Updating to react-hook-form 7.0.0 (instead of the latest)
- It is reproducible on another machine
- Deleted node_modules
Side notes
- The compiling takes long and eats a lot of memory before that error message appears.
- When I start the project in dev mode, it is actually starting and showing the website for a moment, but then switches to that same error message.