davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
333 stars 12 forks source link

Crashes when no baseUrl provided in tsconfig #43

Closed lynxtaa closed 2 years ago

lynxtaa commented 2 years ago

Since Typescript 4.1 we can configure aliases without providing baseUrl https://github.com/microsoft/TypeScript/issues/31869

But alias-hq is throwing TypeError [ERR_INVALID_ARG_TYPE]: The "to" argument must be of type string. Received undefined when loading tsconfig.

It seems to me that the problem is with this line https://github.com/davestewart/alias-hq/blob/19309203d65893dab77c2d71e1fa26a16e8034ad/src/index.js#L169

davestewart commented 2 years ago

Cool. Thanks for the info.

I'm looking at getting all my outstanding OSS tickets done by the end of January.

Without looking at the code, I guess the fix is to default to "" for missing baseUrl ?

lynxtaa commented 2 years ago

Without looking at the code, I guess the fix is to default to "" for missing baseUrl ?

Yeah, I'm pretty sure it'll work

davestewart commented 2 years ago

OK, fixed, and 5.3.1 should be on NPM now.