question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compiling with ivy causes build to fail with ERROR in ENOTDIR: not a directory

See original GitHub issue
  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

The project to build with ivy enabled

Current Behavior

The project fails to build stating that /src/index.ts is not a directory

Failure Information (for bugs)

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.

Context

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

Failure Logs

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.

Other

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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
rt-gavrilovcommented, Jul 10, 2019

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

2reactions
gilhardlcommented, Aug 1, 2019

I 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular 9 library publish error "Trying to publish a package ...
While building my libraries with ng build --prod and enableIvy = false in tsconfig.lib ...
Read more >
Bugs & Issues v4.2.X #807 | Support Center - ABP Commercial
Exception: Build failed! at Volo.Abp.Cli.Build.DefaultDotNetProjectBuilder. ... 31 error errno -20 32 error ENOTDIR: not a directory, ...
Read more >
angular/angular-cli - Gitter
Hi all, I have the following issue: ERROR: Unknown version 67 of android ... src/app/auth/components/login/login.component.scss Module build failed (from .
Read more >
@angular-devkit/build-angular | Yarn - Package Manager
@angular-devkit/build-angular. Commit, Type, Description. ccc8e0350, fix, display actionable error when a style does not exist in Karma builder.
Read more >
Handling __ivy_ngcc_bak compiler errors - devioblog
This changed when Angular Ivy came along as we made the switch to Angular 10. Suddenly, calling ng build after copying the packagr...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found