You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
When consuming an Angular Library that imports a CommonJS dependency, the dependency isn't imported correctly. This is most obvious when there is a default import that is supposed to be able to be used as a constructor, for example:
import Inputmask from 'inputmask';
new Inputmask();
The above succeeds in the application code itself, but not from library code consumed by the application. Instead of the imported type being a function as it should be, it is an object.
The repro is using the latest version of Angular, but I came across this initially while attempting to upgrade from Angular 12.2.16 to 13.3.11, so the issue is present there as well. It's currently blocking my upgrade to Angular 13. This worked fine in Angular 12 and in previous versions.
The issue is also reproducible in component tests.
The text was updated successfully, but these errors were encountered:
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
When consuming an Angular Library that imports a CommonJS dependency, the dependency isn't imported correctly. This is most obvious when there is a default import that is supposed to be able to be used as a constructor, for example:
The above succeeds in the application code itself, but not from library code consumed by the application. Instead of the imported type being a
function
as it should be, it is anobject
.Reproduction attached: ng-lib-dependency-issue.tgz
Please provide a link to a minimal reproduction of the bug
https://github.com/angular/angular/files/9282262/ng-lib-dependency-issue.tgz
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
For the reproduction, just run:
The repro is using the latest version of Angular, but I came across this initially while attempting to upgrade from Angular 12.2.16 to 13.3.11, so the issue is present there as well. It's currently blocking my upgrade to Angular 13. This worked fine in Angular 12 and in previous versions.
The issue is also reproducible in component tests.
The text was updated successfully, but these errors were encountered: