Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ivy (9.1.5) causes build failure #36992

Closed
n9niwas opened this issue May 8, 2020 · 25 comments
Closed

Ivy (9.1.5) causes build failure #36992

n9niwas opened this issue May 8, 2020 · 25 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Milestone

Comments

@n9niwas
Copy link

n9niwas commented May 8, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli (ngcc)

Is this a regression?

Yes, the previous version in which this bug was not present was: `9.1.0`

Description

In JIT mode build fails with
File name 'node_modules/apollo-angular/selectpipe.d.ts' differs from already included file name 'node_modules/apollo-angular/SelectPipe.d.ts' only in casing
In AOT mode build fails with
Symbol SelectPipe declared in * is not exported from apollo-angular

🔬 Minimal Reproduction

Clone https://github.com/n9niwas/ngccbug
Run

yarn
yarn start

🔥 Exception or Error


ERROR in node_modules/apollo-angular/ApolloModule.d.ts:4:25 - error TS1149: File name '/Users/blah/Documents/ngrepros/ngccbug/node_modules/apollo-angular/selectpipe.d.ts' differs from already included file name '/Users/blah/Documents/ngrepros/ngccbug/node_modules/apollo-angular/SelectPipe.d.ts' only in casing.

4 import * as ɵngcc1 from './selectpipe';

Also if I enable aot the error is different:


ERROR in Symbol SelectPipe declared in /Users/blah/Documents/ngrepros/ngccbug/node_modules/apollo-angular/selectpipe.d.ts is not exported from apollo-angular (import into /Users/blah/Documents/ngrepros/ngccbug/src/app/app.component.ts)

This was also working fine in 9.1.0

🌍 Your Environment

Angular Version:


Angular CLI: 9.1.4
Node: 13.11.0
OS: darwin x64

Angular: 9.1.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.4
@angular-devkit/build-angular     0.901.4
@angular-devkit/build-optimizer   0.901.4
@angular-devkit/build-webpack     0.901.4
@angular-devkit/core              9.1.4
@angular-devkit/schematics        9.1.4
@angular/cli                      9.1.4
@ngtools/webpack                  9.1.4
@schematics/angular               9.1.4
@schematics/update                0.901.4
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

Anything else relevant?

@owi1972
Copy link

owi1972 commented May 8, 2020

It also worked in 9.1.3

@sandervn
Copy link
Contributor

sandervn commented May 8, 2020

The build fails in 9.1.5 if Ivy is enabled. If it's not enabled, it succeed.

@wvankuipers
Copy link

Just had the same issue, 9.1.4 builds fine, but 9.1.5 gives the same issue with duplicated file names and incorrect casing.

@wvankuipers
Copy link

Probably related to #36968

@cedricduffournet
Copy link

cedricduffournet commented May 8, 2020

Same issue with angulartics lib: angulartics/angulartics2#380

@petebacondarwin
Copy link
Member

Thanks for the reproduction @n9niwas. It made all the difference!

I have found the problem. It is a bug in ngcc.

During processing ngcc is spotting that the operating system is case-insensitive and then adding imports to files with canonical paths. E.g.

import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
export declare const PROVIDERS: (typeof Apollo)[];
export declare const DECLARATIONS: (typeof SelectPipe)[];
export declare class ApolloModule {
    static ɵmod: ɵngcc0.ɵɵNgModuleDefWithMeta<ApolloModule, [typeof ɵngcc1.SelectPipe], never, [typeof ɵngcc1.SelectPipe]>;
    static ɵinj: ɵngcc0.ɵɵInjectorDef<ApolloModule>;
}

Note that there are two imports to the same file:

import { SelectPipe } from './SelectPipe';
import * as ɵngcc1 from './selectpipe';

The first is from the original file. The second is added by ngcc.

Working on a fix.

@tnlthanzeel
Copy link

same issue i had this morning when i installed a clean version of angular 9 globally

ERROR in TypeError: Cannot read property 'flags' of undefined
at resolveAlias (D:\samples projects\angular9helloword\helloWorld\node_modules\typescript\lib\typescript.js:36513:37)
at checkAliasSymbol (D:\samples projects\angular9helloword\helloWorld\node_modules\typescript\lib\typescript.js:64502:26)
at checkImportBinding (D:\samples projects\angular9helloword\helloWorld\node_modules\typescript\lib\typescript.js:64534:13)
at checkImportDeclaration (D:\samples projects\angular9helloword\helloWorld\node_modules\typescript\lib\typescript.js:64552:29) at checkSourceElementWorker (D:\samples projects\angular9helloword\helloWorld\node_modules\typescript\lib\typescript.js:64961:28)

"devDependencies": {
"@angular-devkit/build-angular": "~0.901.4",
"@angular/cli": "~9.1.4",
"@angular/compiler-cli": "~9.1.4",
"@angular/language-service": "~9.1.4",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
}

Angular CLI: 9.1.4
Node: v12.13.0
OS: windows 10
NPM : 6.12.0

i just did "ng new helloword" and after the project was created i tried "ng s -o" and threw the error above

please help

@timonohe
Copy link

timonohe commented May 8, 2020

Thanks for the reproduction @n9niwas. It made all the difference!

I have found the problem. It is a bug in ngcc.

During processing ngcc is spotting that the operating system is case-insensitive and then adding imports to files with canonical paths. E.g.

import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
export declare const PROVIDERS: (typeof Apollo)[];
export declare const DECLARATIONS: (typeof SelectPipe)[];
export declare class ApolloModule {
    static ɵmod: ɵngcc0.ɵɵNgModuleDefWithMeta<ApolloModule, [typeof ɵngcc1.SelectPipe], never, [typeof ɵngcc1.SelectPipe]>;
    static ɵinj: ɵngcc0.ɵɵInjectorDef<ApolloModule>;
}

Note that there are two imports to the same file:

import { SelectPipe } from './SelectPipe';
import * as ɵngcc1 from './selectpipe';

The first is from the original file. The second is added by ngcc.

Working on a fix.

Nice, thanks for the quick help!

@petebacondarwin petebacondarwin pinned this issue May 8, 2020
@oldmap
Copy link

oldmap commented May 8, 2020

so,
how to fix this problem?

Thanks for the reproduction @n9niwas. It made all the difference!

I have found the problem. It is a bug in ngcc.

During processing ngcc is spotting that the operating system is case-insensitive and then adding imports to files with canonical paths. E.g.

import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
export declare const PROVIDERS: (typeof Apollo)[];
export declare const DECLARATIONS: (typeof SelectPipe)[];
export declare class ApolloModule {
    static ɵmod: ɵngcc0.ɵɵNgModuleDefWithMeta<ApolloModule, [typeof ɵngcc1.SelectPipe], never, [typeof ɵngcc1.SelectPipe]>;
    static ɵinj: ɵngcc0.ɵɵInjectorDef<ApolloModule>;
}

Note that there are two imports to the same file:

import { SelectPipe } from './SelectPipe';
import * as ɵngcc1 from './selectpipe';

The first is from the original file. The second is added by ngcc.

Working on a fix.

now I know it is a bug in ngcc. but how to fix it? My project still not work.
Can someone tell me what should I do?
Many Thanks.(I am a beginner)

@cedricduffournet
Copy link

Waiting for a fix or install previous angular version (previous than 9.1.5 in my case)

@petebacondarwin
Copy link
Member

@XIAOtaoliu - for now roll-back your Angular versions to 9.1.4.
You can do this by changing all the @angular/... framework packages in your package.json to 9.1.4.

E.g.

  "dependencies": {
    "@angular/animations": "9.1.4",
    "@angular/cdk": "^9.2.2",
    "@angular/common": "9.1.4",
    "@angular/compiler": "9.1.4",
    "@angular/core": "9.1.4",
    "@angular/elements": "9.1.4",
    "@angular/forms": "9.1.4",
    "@angular/material": "^9.2.2",
    "@angular/platform-browser": "9.1.4",
    "@angular/platform-browser-dynamic": "9.1.4",
    "@angular/router": "9.1.4",
    "@angular/service-worker": "9.1.4",
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.901.4",
    "@angular/cli": "9.1.4",
    "@angular/compiler-cli": "9.1.4",
    "@angular/language-service": "9.1.4",
    ...

And then re-installing your dependencies (i.e. yarn or npm install).

@tnlthanzeel
Copy link

@XIAOtaoliu - for now roll-back your Angular versions to 9.1.4.
You can do this by changing all the @angular/... framework packages in your package.json to 9.1.4.

E.g.

  "dependencies": {
    "@angular/animations": "9.1.4",
    "@angular/cdk": "^9.2.2",
    "@angular/common": "9.1.4",
    "@angular/compiler": "9.1.4",
    "@angular/core": "9.1.4",
    "@angular/elements": "9.1.4",
    "@angular/forms": "9.1.4",
    "@angular/material": "^9.2.2",
    "@angular/platform-browser": "9.1.4",
    "@angular/platform-browser-dynamic": "9.1.4",
    "@angular/router": "9.1.4",
    "@angular/service-worker": "9.1.4",
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.901.4",
    "@angular/cli": "9.1.4",
    "@angular/compiler-cli": "9.1.4",
    "@angular/language-service": "9.1.4",
    ...

And then re-installing your dependencies (i.e. yarn or npm install).

this is a temporary fix ryt?

@oldmap
Copy link

oldmap commented May 8, 2020

@petebacondarwin
I did this. and now it works.
Thank you very much.

@NamrataDG
Copy link

My Angular versions are already pointing to 9.1.4.But its still failing.
"dependencies": {
"@angular/animations": "~9.1.4",
"@angular/common": "~9.1.4",
"@angular/compiler": "~9.1.4",
"@angular/core": "~9.1.4",
"@angular/forms": "~9.1.4",
"@angular/platform-browser": "~9.1.4",
"@angular/platform-browser-dynamic": "~9.1.4",
"@angular/router": "~9.1.4",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.4",
"@angular/cli": "~9.1.4",
"@angular/compiler-cli": "~9.1.4",
"@angular/language-service": "~9.1.4",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",

@tnlthanzeel
Copy link

My Angular versions are already pointing to 9.1.4.But its still failing.
"dependencies": {
"@angular/animations": "~9.1.4",
"@angular/common": "~9.1.4",
"@angular/compiler": "~9.1.4",
"@angular/core": "~9.1.4",
"@angular/forms": "~9.1.4",
"@angular/platform-browser": "~9.1.4",
"@angular/platform-browser-dynamic": "~9.1.4",
"@angular/router": "~9.1.4",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.4",
"@angular/cli": "~9.1.4",
"@angular/compiler-cli": "~9.1.4",
"@angular/language-service": "~9.1.4",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",

do this

npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4

@simonua
Copy link
Contributor

simonua commented May 8, 2020

@NamrataDG, you are using a tilde wildcard (e.g. "~9.1.4") which will install patch versions. 9.1.5 and 9.1.4 are both valid. Notice how petebacondarwin's versions are pinned explicitly to the versions to use ("9.1.4"). Once updated, run npm i, and you should be good to go.

@NamrataDG
Copy link

@simonua Thanks a lot..It worked.

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 8, 2020
The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes angular#36992, angular#36993, angular#37000
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 8, 2020
The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes angular#36992, angular#36993, angular#37000
@petebacondarwin
Copy link
Member

petebacondarwin commented May 8, 2020

It appears, at least locally for me, that #37008 fixes the problem in https://github.com/n9niwas/ngccbug

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 8, 2020
…o case-sensitivity (angular#36968)"

This reverts commit dcf1dcb.

The changes to the case-sensitivity handling in angular#36968 caused multiple
projects to fail to build. See angular#36992, angular#36993 and angular#37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 8, 2020
…ittle to case-sensitivity (angular#36968)"

This reverts commit c6e5225.

The changes to the case-sensitivity handling in angular#36968 caused multiple
projects to fail to build. See angular#36992, angular#36993 and angular#37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 8, 2020
…ase-sensitivity (angular#36968)"

This reverts commit 3361f59.

The changes to the case-sensitivity handling in angular#36968 caused multiple
projects to fail to build. See angular#36992, angular#36993 and angular#37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.
alxhub pushed a commit that referenced this issue May 8, 2020
…ase-sensitivity (#36968)" (#37003)

This reverts commit 3361f59.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…paths (#36968)" (#37003)

This reverts commit 7e9d5f5.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
#36968)" (#37003)

This reverts commit 654868f.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…tivity (#36968)" (#37003)

This reverts commit b6c042d.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…36968)" (#37003)

This reverts commit 4becc1b.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…ivity (#36968)" (#37003)

This reverts commit 5bddeea.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…itivity (#36968)" (#37003)

This reverts commit 65337fb.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
alxhub pushed a commit that referenced this issue May 8, 2020
…erHost (#36968)" (#37003)

This reverts commit 4abd603.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
@alxhub alxhub added area: compiler Issues related to `ngc`, Angular's template compiler regression Indicates than the issue relates to something that worked in a previous version type: bug/fix labels May 8, 2020
@ngbot ngbot bot modified the milestone: needsTriage May 8, 2020
@petebacondarwin
Copy link
Member

We have just released 9.1.6 which should not have this problem. Please test.

@petebacondarwin petebacondarwin unpinned this issue May 8, 2020
@christopherthielen
Copy link

9.1.6 works for me, thanks for the quick turnaround!

@cedricduffournet
Copy link

9.1.6 works for me also, thanks

@mgechev
Copy link
Member

mgechev commented May 8, 2020

As @petebacondarwin mentioned, upgrading to 9.1.6 should fix the problem. Closing the issue now. In case the problem is still not resolved, feel free to open a new one.

@mgechev mgechev closed this as completed May 8, 2020
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 14, 2020
The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes angular#36992, angular#36993, angular#37000
@johndobrien
Copy link

This is back after upgrading to 9.1.7

@petebacondarwin
Copy link
Member

Can you provide more details in a fresh issue please @webm0nk3y

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue May 15, 2020
The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes angular#36992, angular#36993, angular#37000
kara pushed a commit that referenced this issue May 18, 2020
…37008)

The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes #36992, #36993, #37000

PR Close #37008
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 14, 2020
profanis pushed a commit to profanis/angular that referenced this issue Sep 5, 2020
…ngular#37008)

The work to support case-sensitivity in the `FileSystem` went too far
with the `LogicalFileSystem`, which is used to compute import paths
that will be added to files processed by ngtsc and ngcc.

Previously all logical paths were canonicalised, which meant that on
case-insensitive file-systems, the paths were all set to lower case.
This resulted in incorrect imports being added to files. For example:

```
import { Apollo } from './Apollo';
import { SelectPipe } from './SelectPipe';
import * as ɵngcc0 from '@angular/core';
import * as ɵngcc1 from './selectpipe';
```

The import from `./SelectPipe` is from the original file, while the
import from `./selectpipe` is added by ngcc. This causes the
TypeScript compiler to complain, or worse for paths not to be
matched correctly.

Now, when computing logical paths, the original absolute paths
are matched against rootDirs in a canonical manner, but the actual
logical path that is returned maintains it original casing.

Fixes angular#36992, angular#36993, angular#37000

PR Close angular#37008
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler regression Indicates than the issue relates to something that worked in a previous version type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.