Standalone Angular Component has errors with AddinClientService and SkyThemeService
I have created addins previously but never both as a newer Angular standalone component and also using SkyUX components.
When I attempt to load my addin I get the following error caught in the bootstrap statement in main.ts.
main.ts:6 ERROR NullInjectorError: NullInjectorError: No provider for _SkyThemeService!
at NullInjector.get (core.mjs:1654:27)
at R3Injector.get (core.mjs:3093:33)
at R3Injector.get (core.mjs:3093:33)
at injectInjectorOnly (core.mjs:1100:40)
at ɵɵinject (core.mjs:1106:42)
at inject (core.mjs:1192:12)
at new _AddinClientService (blackbaud-skyux-lib-addin-client.mjs:55:26)
at Object.AddinClientService_Factory [as factory] (blackbaud-skyux-lib-addin-client.mjs:262:14)
at core.mjs:3219:47
at runInInjectorProfilerContext (core.mjs:866:9)
Has anybody encountered this? I have attempted to add both AddinClientService and SkyThemeService (which I do not use directly) to the providers array of my app.config.ts file as below:
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
provideHttpClient(),
importProvidersFrom([
AddinClientService,
SkyThemeService
]),
]
};
Nothing that I do seems to help. Any thoughts about why this is happening?
Comments
-
So I have been testing a little and created a new pared back application. It has one component that does nothing other than the default statement that the component works.
As soon as I added
constructor(clientService: AddinClientService){}
I got the previous error. I attempted to add the service to the app.config.ts file as below:
export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes),
importProvidersFrom(AddinClientService)
]};This did not help though. The error
NullInjectorError: No provider for _SkyThemeService
makes me think that it is not something that I am doing given that I am not directly referencing the SkyThemeService.
0 -
@Michael Tims (I hope that you are active on this community). I took a look at the github source and can see that the SkyThemeService is added to the providers section for the showcase project but there does not appear to be a place to add it into AddinClientService. I am not familiar with creating services as a library without any module file at all (and this does not appear to follow the standalone model).
@Chris Rodgers any thoughts?
0 -
Hi @David Zeidman - not aware of any issues at the moment with being able to have the `SkyThemeService` provided with standalone components. I will try to reproduce the issue today and report back.
1 -
@Michael Tims Thank you. Just to be clear, I am not using the SkyThemeService directly. My pared back standalone app simply injected the AddClientService to the component and I got that error.
0 -
Just in case anybody should come across this thread and want to know how it was resolved, here is what @Michael Tims came up with as a workaround.
import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router';
import { SkyThemeService } from '@skyux/theme';
import { routes } from './app.routes';
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(routes),
SkyThemeService
]
};By adding the SkyThemeService to the providers array directly (and not using the importProvidersFrom function), the solution worked.
However, this may well change in the future as there ought not to be a need to add this as a reference when adding the AddinClientService which should encapsulate everything it needs.
1
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®
- 656 Blackbaud Grantmaking™
- 577 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)

