Skip to content

Misleading error message #4

Description

@netdown

Hi,

The Error which may be thrown in ts2doc function of packages/json/src/index.ts has logical issues.

In my specific case, I have 2 subfolders in my src folder: config and lib. I have pointed patternDocType to the lib folder as in the config folder I only have static objects.

During initialization, I have received the following error:
Unable to find following files: libs/shared/ui/src/lib/form/Input/common.ts, libs/shared/ui/src/lib/utils.ts

It took me quite a while to figure out that for some reason, program.getSourceFiles() resolved my .tsx files with relative path, but .ts files with absolute path. Therefore filesPath.filter((file) => !filesParsed.includes(file)) is false for these 2 entries, although they are present in the array with an absolute path.

Meanwhile, the files I have in the config folder are present in filesParsed, but missing from filesPath (thats why the error condition is true) and will never be included in the error message, as it only contains files present in filesPath but missing from filesParsed.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions