question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

subscribeSpyTo<T> returns SubscriberSpy<unknown> instead of SubscriberSpy<T>

See original GitHub issue

Describe the bug subscribeSpyTo<T> returns SubscriberSpy<unknown> instead of SubscriberSpy<T>

To Reproduce

  1. Create a new angular project
  2. Install @hirez_io/observer-spy
  3. Use subscribeSpyTo to test a string observable, for example - of('str')
  4. See that it returns SubscriberSpy<unknown> instead of SubscriberSpy<string>

Expected behavior It should return SubscriberSpy<string> instead of SubscriberSpy<unknown>

Screenshots Bug - image Source code for subscribeSpyTo - image

Desktop (please complete the following information): Angular CLI: 13.1.2 Node: 14.18.2 Package Manager: npm 6.14.15 OS: linux x64

Angular: 13.1.1 … animations, common, compiler, compiler-cli, core, forms … platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1301.2 @angular-devkit/build-angular 13.1.2 @angular-devkit/core 13.1.2 @angular-devkit/schematics 13.1.2 @angular/cli 13.1.2 @schematics/angular 13.1.2 rxjs 7.4.0 typescript 4.5.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
batbrain9392commented, Jan 11, 2022

Thanks a ton, Shai! It works now.

0reactions
shairezcommented, Jan 2, 2022

OK I managed to fix it (somehow) in version 2.1.2

For some reason, only the .d.ts files generated by the CI build got unknown as generics (while locally it was building with the correct <T> generic)

So I re-ran the build and it built it correctly this time

No clue to why it got messed up, but my guess is a TypeScript version voodoo 🤷‍♀️😅

Anyway, please test it and see if it works (closing for now)

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ | SubscribeStar
"Do you accept prepaid cards to use for subscriptions?" ... "Is it possible to withdraw funds yearly or longer, rather than monthly?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found