Posted 5 December 2024, 10:54 pm EST
Dear Mescius,
We’re in the process of updating our application to Angular 19. Of note, the new default for a component is that it is standalone, and a component must opt out of this if it wants to be included in a module.
Our application itself seems to build and run fine using Wijmo 5.20242.21
Our tests, on the other hand, seem to have a problem. They declare testing modules, and the process of importing a module that includes Wijmo results in this error:
Error: Unexpected "WjTooltip" found in the "declarations" array of the "WjCoreModule" NgModule, "WjTooltip" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?
Unexpected "WjComponentLoader" found in the "declarations" array of the "WjCoreModule" NgModule, "WjComponentLoader" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?
at verifySemanticsOfNgModuleDef (node_modules/@angular/core/fesm2022/core.mjs:33645:15)
at forEach (node_modules/@angular/core/fesm2022/core.mjs:33619:9)
at Array.forEach (<anonymous>)
at verifySemanticsOfNgModuleDef (node_modules/@angular/core/fesm2022/core.mjs:33617:10)
at forEach (node_modules/@angular/core/fesm2022/core.mjs:33619:9)
at Array.forEach (<anonymous>)
at verifySemanticsOfNgModuleDef (node_modules/@angular/core/fesm2022/core.mjs:33617:10)
at forEach (node_modules/@angular/core/fesm2022/core.mjs:33619:9)
at Array.forEach (<anonymous>)
at verifySemanticsOfNgModuleDef (node_modules/@angular/core/fesm2022/core.mjs:33617:10)
After a quick look at Angular’s processing of this, it looks like it is assuming that a component is standalone even if it isn’t built that way (due to the absence of the standalone property in the component metadata), and that seems to be tripping it up.
I tried the latest Wijmo nightly and that has the same problem.
Has anyone experienced this? Are there any known work-arounds? Are there any changes coming that might address this?
I suspect that if the Wijmo components explicitly declare the standalone property, this issue would just go away.