adobe / aem-guides-wknd-spa

MIT License
71 stars 97 forks source link

[Angular] npm test fails #9

Closed godanny86 closed 3 years ago

godanny86 commented 3 years ago

Error occurs when npm test is run:

ERROR in src/app/components/page/page.component.spec.ts:42:49 - error TS2345: Argument of type '() => Promise<{}>' is not assignable to parameter of type '<M extends Model>(config?: string | ModelManagerConfiguration) => Promise<M>'.
  Type 'Promise<{}>' is not assignable to type 'Promise<M>'.
    Type '{}' is not assignable to type 'M'.
      '{}' is assignable to the constraint of type 'M', but 'M' could be instantiated with a different subtype of constraint 'Model'.
viveksr2 commented 3 years ago

Facing the same issue while creating Archetype 23 project on Linux server. On Windows it is working fine. error

viveksr2 commented 3 years ago

Any updates on this issue @godanny86 ?

godanny86 commented 3 years ago

@viveksr2 engineering is still looking in to it. In the mean time you can simply remove the file: src/app/components/page/page.component.spec.ts to get around it...

godanny86 commented 3 years ago

Actually this has been fixed in the archetype and this project will be updated today. @viveksr2 checkout the changes here: https://github.com/adobe/aem-project-archetype/pull/461/files

godanny86 commented 3 years ago

This has been fixed across Angular branches: https://github.com/adobe/aem-guides-wknd-spa/commit/ec0e25654153e60d6229b5a5af0418132935acfb

viveksr2 commented 3 years ago

Thanks for the information @godanny86 👍