The project to build with ivy enabled
The project fails to build stating that /src/index.ts is not a directory
I just updated to the latest angular 8.1.0 and tried to enable ivy in my project.
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"enableIvy": true
}
But I've been having troubles with the tsconfig.json path mappings.
if I enable ivy i get:
ERROR in ENOTDIR: not a directory, scandir '/Users/leon/project/libs/portal/feature-auth/src/index.ts'
"@leon/portal/feature-auth": ["libs/portal/feature-auth/src/index.ts"],
If i change the mapping to
"@leon/portal/feature-auth": ["libs/portal/feature-auth/src/"],
everything works
it seams that something is requiring that the typescript import is a directory and not a file.
Please provide any relevant information about your setup:
Nx version used: 8.2.0
Angular CLI: 8.1.0
Node: 12.5.0
OS: darwin x64
Angular: 8.1.0
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.801.0
@angular-devkit/build-angular 0.801.0
@angular-devkit/build-optimizer 0.801.0
@angular-devkit/build-webpack 0.801.0
@angular-devkit/core 8.0.1
@angular-devkit/schematics 8.0.1
@angular/cdk 8.0.2
@angular/fire 5.2.1
@angular/material 8.0.2
@ngtools/webpack 8.1.0
@schematics/angular 8.1.0
@schematics/update 0.801.0
rxjs 6.5.2
typescript 3.4.5
webpack 4.35.2
ERROR in ENOTDIR: not a directory, scandir '/Users/leon/project/libs/portal/feature-auth/src/index.ts'
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.
I tried to reproduce the error by creating a new nx workspace, but where unable to reproduce the error.
I'm not sure how I can debug where the log statement is coming from. I tried the --verbose setting but to no success.
any suggestions on how I can debug this?
same problem
To try Ivy, please use the latest version of Angular which is 8.2.0-next.0.
That does not solve your problem here, just saying :)
Tested with 8.2.0-next.0 and the problem occurs on our side too
Same problem, using 8.2.0-next.0
same problem
Folks. Could any of you provide a repo with a repro?
Similar issue here
https://github.com/angular/angular/issues/29361
I got this error in a new workspace after running ng update @angular/core @angular/cli:
ERROR in ENOTDIR: not a directory, scandir '/Users/gperdomor/Downloads/nx-platform/libs/api-interface/src/index.ts'
After disabling ivy everything compiles fine
8.2.0-next.1 has solved the issue with ERROR in ENOTDIR: not a directory
but the next one appeared then: ERROR in Unable to write a reference
which is fully described here: angular/angular#29361
and there's no workaround still
@vsavkin please take a look
Yup, I know about the issue in the angular repo. I cannot repro the issue.
Folks, could you provide a repro?
@vsavkin here is a repo that exhibits the issue: https://github.com/wesleygrimes/nx-full-stack-issue-reproduction
I can reproduce from scratch by doing the following...
$ npx create-nx-workspace@latest test-appfull stack optionng update to see that rxjs and @angular/cli are out of date.ng update @angular/cli @angular/core to update depsng serve test-appThe following error outputs:
10% building 3/3 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html
chunk {main} main.js, main.js.map (main) 2.23 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 157 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.09 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.7 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 341 kB [initial] [rendered]
Date: 2019-07-12T21:46:39.263Z - Hash: a49c2eb17832d0b4003e - Time: 1609ms
ERROR in ENOTDIR: not a directory, scandir '/Users/wes/sandbox/test-app/libs/api-interface/src/index.ts'
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Failed to compile.
If I go to test-app/apps/test-app/tsconfig.app.json and change angularCompilerOptions.enableIvy to false then it compiles successfully.
I wonder if perhaps there is an issue with the latest version of Angular which is 8.1.1.
Finally, there IS a workaround (which works in my project):
"rootDir": "." to the compilerOptions in the root tsconfig.jsonI had the same error with Angular 8.1.2 :
ERROR in ENOTDIR: not a directory, scandir '/c/Users/LG/code/git-mirroring/libs/api-interfaces/src/index.ts'
Updating angularCompilerOptions.enableIvy from _/c/Users/LG/code/git-mirroring/apps/git-mirroring/tsconfig.app.json_ "fixed" the compilation error but was not a great workaround.
Upgrading Angular to 8.2.0 solved the problem for me. Now the app compiles well, with Ivy enabled.
@gilhardl I did the same, and solved this issue for me. @vsavkin I think we should close this one, and advise users on Ivy, to upgrade to 8.2.0, or higher. I was able to run npm update from Angular 8.0.0, and didn't run across any issues
It looks like updating to Angular 8.2 resolves the problem. Thank you folks for troubleshooting it.
I'm going to close this issue.
i use angular version 8.2.6 and still have this problem with ivy
@larscom Might not fix your issue, but if you want to try Ivy, you should be on the next tag, currently 9.0.0-next.6.
Most helpful comment
8.2.0-next.1 has solved the issue with
ERROR in ENOTDIR: not a directorybut the next one appeared then:
ERROR in Unable to write a referencewhich is fully described here: angular/angular#29361
and there's no workaround still
@vsavkin please take a look