Describe the bug
Unable to build Angular library after upgrading angular-auth-oidc-client to version 11.
ERROR: Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵc in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?).
Can't resolve all parameters for OidcSecurityService in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, ?, [object Object], [object Object], [object Object], [object Object], ?, [object Object], ?, [object Object], [object Object], [object Object], [object Object], [object Object], ?).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵbb in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], ?, ?).
Can't resolve all parameters for ɵp in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object]).
Can't resolve all parameters for ɵr in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵy in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: ([object Object], ?, [object Object], ?, ?, [object Object], ?).
Can't resolve all parameters for ɵg in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: ([object Object], ?, ?, [object Object], [object Object], ?, [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵo in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], ?, ?, [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵt in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], ?, [object Object]).
Invalid provider for undefined. useClass cannot be undefined.
Usually it happens when:
1. There's a circular dependency (might be caused by using index.ts (barrel) files).
2. Class was used before it was declared. Use forwardRef in this case.
An unhandled exception occurred: Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵc in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?).
Can't resolve all parameters for OidcSecurityService in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, ?, [object Object], [object Object], [object Object], [object Object], ?, [object Object], ?, [object Object], [object Object], [object Object], [object Object], [object Object], ?).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵbb in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], ?, ?).
Can't resolve all parameters for ɵp in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object]).
Can't resolve all parameters for ɵr in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object], [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵy in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: ([object Object], ?, [object Object], ?, ?, [object Object], ?).
Can't resolve all parameters for ɵg in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: ([object Object], ?, ?, [object Object], [object Object], ?, [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵo in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], ?, ?, [object Object]).
Encountered undefined provider! Usually this means you have a circular dependencies. This might be caused by using 'barrel' index.ts files.
Can't resolve all parameters for ɵt in D:/Dev/TestProjects/oidc-client-lib-test/node_modules/angular-auth-oidc-client/angular-auth-oidc-client.d.ts: (?, [object Object], [object Object], [object Object], ?, [object Object]).
Invalid provider for undefined. useClass cannot be undefined.
Usually it happens when:
1. There's a circular dependency (might be caused by using index.ts (barrel) files).
2. Class was used before it was declared. Use forwardRef in this case.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Build Angular library without any errors as it worked in v10.0.15
Desktop (please complete the following information):
Hey @csharpexpert thanks. So to be clear. You are using the angular-oidc-lib in another lib which you do lazy load or not lazy load? Thanks :) Will try to reproduce tomorrow.
Not lazy load. I created a new project from scratch exactly in steps I described. No code except importing angular-auth-oidc-client and adding AuthModule.forRoot() to NgModule. Angular project doesn't even have any reference to this library.
Our project also seems to suffer from an error like this one.
However in our case it happens with our main angular app, not a project.
In our case it also only happens when we run xliffmerge from the @ngx-i18nsupport/ngx-i18nsupport package. The normal ng build seems to work fine.
My assumption is that with the default builder, angular-auth-oidc-client seems to work fine. But with special builders like the one used in xliffmerge and projects there's something odd happening.
We are currently working on a fix. Going to push it out asap. Thanks.
We just published a new version 11.0.1 with the fix, so you might try that out. We could reproduce the issue with the steps you provided and in our tests the problem is fixed now.
Build works, thank you.
Most helpful comment
We are currently working on a fix. Going to push it out asap. Thanks.