我有一个库模块,并在angular cli主机应用程序中使用此模块。我试过this 但我得到的错误如下所示:
ERROR in Error: Error encountered resolving symbol values statically. Calling function 'WebStorageStateStore',
function calls are not supported. Consider replacing the function or lambda with a reference to an exported function,
resolving symbol environment in C:/Projects/Latest_Nov20/FrontEnd/OdyssEY-UI-Host/src/environments/environment.ts,
resolving symbol CUSTOM_IMPORTS in C:/Projects/Latest_Nov20/FrontEnd/OdyssEY-UI-Host/custom/custom.app.ts,
resolving symbol CUSTOM_IMPORTS in C:/Projects/Latest_Nov20/FrontEnd/OdyssEY-UI-Host/custom/custom.app.ts,
resolving symbol AppModule in C:/Projects/Latest_Nov20/FrontEnd/OdyssEY-UI-Host/src/app/app.module.ts,
resolving symbol AppModule in C:/Projects/Latest_Nov20/FrontEnd/OdyssEY-UI-Host/src/app/app.module.ts
以下是我尝试在共享库中使用的环境设置:
主要主机应用程序中的environment.ts:
import { WebStorageStateStore } from 'oidc-client';
export const environment = {
production: false,
openIdConnectSettings: {
authority: 'https://localhost:44300/identity/',
redirect_uri: 'http://localhost:4200/dashboard',
post_logout_redirect_uri: 'http://localhost:4200',
client_id: 'clientid',
response_type: 'id_token token',
scope: 'openid profile web_api',
filterProtocolClaims: true,
loadUserInfo: true,
revokeAccessTokenOnSignout: true,
userStore: new WebStorageStateStore({ store: window.localStorage })
}
};