Rich McCluskey
Rich McCluskey

Reputation: 2011

How to import ClrCommonStrings from clarity

I recently upgraded Clarity to version 0.13.1-patch.1 from version 0.12.x. Along with this version change came the "Internationalized titles for accessibility" feature (see changelog here).

Serving the app with ng serve runs just fine with no errors, but as soon as I go to the site in the browser I get the following error:

Error: StaticInjectorError(AppModule)[ClrVerticalNavGroup -> ClrCommonStrings]: 
  StaticInjectorError(Platform: core)[ClrVerticalNavGroup -> ClrCommonStrings]: 
    NullInjectorError: No provider for ClrCommonStrings!
    at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (vendor.js:39884)
    at resolveToken (vendor.js:40122)
    at tryResolveToken (vendor.js:40066)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (vendor.js:39963)
    at resolveToken (vendor.js:40122)
    at tryResolveToken (vendor.js:40066)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (vendor.js:39963)
    at resolveNgModuleDep (vendor.js:47198)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (vendor.js:47886)
    at resolveDep (vendor.js:48251)

We have not been importing ClarityModule in the root AppModule but instead importing the specific clarity feature modules as we need them. I tried various ways to provide ClrCommonStrings directly but it doesn't seem to actually be exported from anywhere.

So my question is, should I be able to provide ClrCommonStrings or is it expected behavior that I have to import ClarityModule and should not be importing the feature modules?

Upvotes: 0

Views: 148

Answers (1)

Eudes
Eudes

Reputation: 1661

This was fixed as part of the 0.13.2 release. You should now not have to do anything if you just want the default English titles, even if you only import feature modules.

Upvotes: 1

Related Questions