Coming soon - Get a detailed view of why an account is flagged as spam!
view details
9
TS keeps throwing file not found: root file specified for compilation error (details in post)
Post Body

I have a NX monorepo with the following structure:

apps/ ├── api/ │ ├── src/ │ ├── tsconfig.json │ └── tsconfig.lib.json └── client/ ├── src ├── tsconfig.json └── tsconfig.lib.json libs/ ├── api/ │ ├── src/ │ ├── tsconfig.json │ └── tsconfig.lib.json ├── ui/ │ ├── src/ │ │ ├── button/ │ │ │ ├── index.ts │ │ │ └── Button.tsx │ │ └── ... │ ├── tsconfig.json │ └── tsconfig.lib.json └── shared/ └── ... tsconfig.base.json

``` tsconfig.base.json { "compilerOptions": { ... "rootDir": ".", "baseUrl": ".", "paths": { "@name/api": ["libs/api/src/index.ts"], "@name/ui/": [ "libs/ui/src//index.ts" ], }, "exclude": ["tmp"] }

tsconfig.json { "compilerOptions": { ... }, "references": [ { "path": "./tsconfig.lib.json" } ], "extends": "../../tsconfig.base.json" }

tsconfig.lib.json { "extends": "./tsconfig.json", "compilerOptions": { ... }, "include": ["src//*.js", "src//.jsx", "src//.ts", "src/*/.tsx"] }

```

All components are exported via index.ts if it needs to be exposed to other projects.

TS keeps complaining about the path for @name/ui/* giving this error multiple times: File '/workspace/libs/ui/src/*/index.ts' not found. The file is in the program because: Root file specified for compilation

I did some basic research and I think putting a file after a wildcard is valid, and the code does work. I just hope I can get rid of this specific error. Any help is appreciated!

Author
Account Strength
90%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,041
Link Karma
556
Comment Karma
485
Profile updated: 5 days ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago