Closed doomsower closed 5 years ago
Ran in to this error myself today, and got a mysterious error from react-native:
Cannot convert undefined or null to object
because of this line:
As it turns out, my tsconfig
file didn't have a compilerOptions
field defined because it uses extends
to inherit from a different file. A nicer error message here would be great, and even better would be support for extends
!
TypeScript itself likely provides APIs for loading its config files; so that should make things easier than figuring out how to handle extends
manually.
@doomsower @JKillian Kudos to both of you. 👏
Thank to you, I manage to workaround the issue by adding compilerOptions: {}
in my tsconfig.json
file
Nevermind, the compilerOptions
in the parent tsconfig.json
are not read so it's not a viable solution 😄
I have a monorepo with multiple typescript projects. To keep tsconfigs simple and synced I decided to extract common
tconfig.json
in project root and extend it inside packages. For react-native projects,yarn run tsc
works fine, however packager fails.It seems that
react-native-typescript-transformer
only reads top-level tsconfig and doesn't followextends
hierarchy.It would be nice if someone could fix this