I have an angular project inside an NX monorepo.
when I serve the app everything works, however when I build for production I get a lot of errors like the following:
libs/data/persistance/firebase/src/lib/data-persistance-firebase.module.ts:1:1 -
error TS6059: File
'C:/Users/jorda/source/repos/ng-firebase/firebase-demo/libs/data/persistance/firebase/src/lib/data-persistance-firebase.module.ngtypecheck.ts'
is not under 'rootDir'
'C:\Users\jorda\source\repos\ng-firebase\firebase-demo\libs\data\state\auth\src'.
'rootDir' is expected to contain all source files.
I have reviewed the paths config of the workspace root tsconfig.base.json:
"paths": {
"@fba/data/persistance/firebase": ["libs/data/persistance/firebase/src/index.ts"],
"@fba/data/state/auth": ["libs/data/state/auth/src/index.ts"],
"@fba/feature/auth": ["libs/feature/auth/src/index.ts"],
"@fba/feature/feature-one": ["libs/feature/feature-one/src/index.ts"],
"@fba/feature/feature-two": ["libs/feature/feature-two/src/index.ts"]
},
but everything looks good here
As far as I can see all imports use "@fba/..." syntax when importing from another lib.
I am not sure how to debug this.
The libs all have build targets and tsconfig.ts,ng-package.json, and project.json files.
I tried:
Can someone help me understand what is going on here?
For me it turned out to be an issue when I migrated from an angular project to a nx monorepo. The migration failed and so the config files were not properly formed, mostly the tsconfig and project.json files.
I removed and re added the NX libs and that fixed the issues for me. It was a lot of work but it was the solution.