Closed Ketec closed 1 year ago
@Ketec Did you ever come up with a solution to this issue?
We're getting the same error with @angular-architects/module-federation
(Webpack 5 Module Federation).
"keycloak-angular": "^13.0.0",
"keycloak-js": "^20.0.3",
"@angular-architects/module-federation": "^15.0.3",
"@angular/core": "^15.1.3",
"typescript": "~4.9.5"
I had to specifically add this to a custom excluded list in the shell. It seems to break if it is shared with remote modules.
That's assuming none of the remotes need to use Keycloak service anywhere.
I had to specifically add this to a custom excluded list in the shell. It seems to break if it is shared with remote modules.
That's assuming none of the remotes need to use Keycloak service anywhere.
@Ketec I have the same issue . Can u provide a more specific workaround for this please. thx. What is a custom excluded list and what did u exclude ?
The shareAll in webpack conf has one additional parameter for skip list.
const DEFAULT_SKIP_LIST = [
'@angular-architects/module-federation',
'@angular-architects/module-federation-runtime',
'tslib',
'zone.js',
'keycloak-js'
];
I added keycloak-js - need to include the others (they were in the module federation library, but the skip parameter overrides defaults).
Thank you for sharing the solution @Ketec. I'm going to close this issue for now. If something new appears, please let me know. Thanks!
I am also facing similar issue when I try to use this library with Nx . Is there solution ? or we need to directly use keycloak-js instead of angular keycloak
I am also facing similar issue when I try to use this library with Nx . Is there solution ? or we need to directly use keycloak-js instead of angular keycloak
Did you find a solution?
Facing the same issue here. Tried with the skip list array mentioned by @Ketec but that also does not work
Getting the error with MFE (therefor with webpack 5).
TypeError: keycloak_js__WEBPACK_IMPORTED_MODULE_5__ is not a constructor
pointing to the
this._instance = new Keycloak(config);
I tried same init logic in code:
And it seems to work fine - so keycloak-js itself seems to be fine.