Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular Github repo fails on dependency injection #1043

Closed
CobusKruger opened this issue Aug 19, 2019 · 1 comment
Closed

Angular Github repo fails on dependency injection #1043

CobusKruger opened this issue Aug 19, 2019 · 1 comment

Comments

@CobusKruger
Copy link

I've seen a few similar issues, with different error messages.

I have a simple Angular application that builds and runs locally (even with AOT), but fails in StackBlitz.

Here is the repo:
https://github.com/CobusKruger/Demo-Observables-Subscriptions

The error message I get is:

Error in /turbo_modules/@angular/compiler@8.2.2/bundles/compiler.umd.js (2603:21)
Can't resolve all parameters for SubscribeUnsubscribeComponent: (?).

The component constructor takes one parameter, which is a service that is part of the repo, using the new Angular providedIn syntax:

@Injectable({
  providedIn: 'root'
})
export class PrimeService {
//
}

This is similar to the errors one gets with ng test when you don't specifically create and supply the objects to inject, so it looks like dependency injection is broken.

My googling showed that many people have (had?) a similar problem, but the error message was always for parameters to ApplicationModule. The fix for that is ostensibly to install core-js@2.6.9 (other versions cause other problems) and import core-js/es7/reflect into polyfils.ts, but that just gets me stuck in a loop where StackBlitz cannot find core-js, installs it, cannot find it, installs it, etc.

@kc0tlh
Copy link
Collaborator

kc0tlh commented Aug 31, 2023

This issue is now resolved in our new VS Code editor! Additional details in Github issue #2473

Check it out for yourself here: https://pr.new/github.com/CobusKruger/Demo-Observables-Subscriptions

@kc0tlh kc0tlh closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants