Error calling AddinClientService
I have done numerous addins in the past but I have never had this error before.
I have an angular app with a parent component and router outlet to the child component. Irrespective of whether I put this code in the parent or child I get the same error message.
In ngOnInit I have added the very simple code as follows:
public ngOnInit() {
console.log("in ngoniinit");
console.log("in 2");
this._AddinClientService.args.subscribe((args: AddinClientInitArgs) => {
console.log("In login.component addiniclientservice.args.subscribe");
this.environmentId = args.envId;
sessionStorage.setItem("envId", args.envId ?? "")
args.ready({
showUI: true, title: environment.appDisplayName
});
});
My console shows the following:
In app.component ngoninit
in ngoniinit
in 2
ERROR TypeError: Cannot read properties of undefined (reading 'app')
at r.initializeTheme (main-QVCS4SD6.js:234:77006)
at Object.init (main-QVCS4SD6.js:234:75400)
at r.handleMessage (main-QVCS4SD6.js:1:29864)
at windowMessageHandler (main-QVCS4SD6.js:1:26021)
at f.invokeTask (polyfills-FFHMD2TL.js:1:7068)
at Object.onInvokeTask (chunk-NBNEUFUA.js:7:29616)
at f.invokeTask (polyfills-FFHMD2TL.js:1:6989)
at t.runTask (polyfills-FFHMD2TL.js:1:2375)
at E.invokeTask [as invoke] (polyfills-FFHMD2TL.js:1:8144)
at I (polyfills-FFHMD2TL.js:1:15196)
(The first console line comes from the parent ngOnInit method).
It never comes out of my _AddinClientService clause. Is there something that has not been initialised correctly? Do I need to set something else up?
Thanks in advance for any help
Comments
-
So I have traced the error back to line 303 of addin-client.service.ts:
That is the only reference to “app” in that method. The reference is to the SkyAppConfig service that is injected in. The app is not defined.
I am not sure if this is related or not but… when I inject my own SkyAppConfig into my application, it does not appear to be initialized either. Both runtime and skyux properties come out as undefined.
Should it be like this or have I done something wrong?
0 -
So… I think that I fixed this.
I am not sure why it should cause this issue because this seems like bad design to me but…
In my code there were references to SkyAppConfig which was being injected in the root app.config.ts. (If you don't happen to have an app.config.ts file, it could be that you have put all your app configuration in your main.ts instead)
When I removed this these errors went away and I was able to use the AddinClientService as intended without it crashing.
Should it really be that fragile??
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 941 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
