aleclarson / vite-tsconfig-paths

Support for TypeScript's path mapping in Vite
MIT License
1.24k stars 43 forks source link

v4 fails if tsconfig exists, but does not contain compilerOptions #93

Closed simon-abbott closed 1 year ago

simon-abbott commented 1 year ago

When using v4.x on a project that has a tsconfig file that does not specify the "compilerOptions" key, it fails with the error "Cannot destructure property 'baseUrl' of 'options' as it is undefined" in createResolver. You should probably add a null check between these lines:

https://github.com/aleclarson/vite-tsconfig-paths/blob/d6d2b736e54fdec35c3ca70e7daa3ad7e299f076/src/index.ts#L170-L171

aleclarson commented 1 year ago

pr welcome