{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/angular/issues/1608","repository_url":"https://api.github.com/repos/dart-lang/angular","labels_url":"https://api.github.com/repos/dart-lang/angular/issues/1608/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/angular/issues/1608/comments","events_url":"https://api.github.com/repos/dart-lang/angular/issues/1608/events","html_url":"https://github.com/dart-lang/angular/issues/1608","id":358656236,"node_id":"MDU6SXNzdWUzNTg2NTYyMzY=","number":1608,"title":"runAppLegacy() and runAppLegacyAsync() only work with FactoryProviders","user":{"login":"szepeshazi","id":691819,"node_id":"MDQ6VXNlcjY5MTgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/691819?v=4","gravatar_id":"","url":"https://api.github.com/users/szepeshazi","html_url":"https://github.com/szepeshazi","followers_url":"https://api.github.com/users/szepeshazi/followers","following_url":"https://api.github.com/users/szepeshazi/following{/other_user}","gists_url":"https://api.github.com/users/szepeshazi/gists{/gist_id}","starred_url":"https://api.github.com/users/szepeshazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szepeshazi/subscriptions","organizations_url":"https://api.github.com/users/szepeshazi/orgs","repos_url":"https://api.github.com/users/szepeshazi/repos","events_url":"https://api.github.com/users/szepeshazi/events{/privacy}","received_events_url":"https://api.github.com/users/szepeshazi/received_events","type":"User","site_admin":false},"labels":[{"id":465150183,"node_id":"MDU6TGFiZWw0NjUxNTAxODM=","url":"https://api.github.com/repos/dart-lang/angular/labels/resolution:%20as%20intended","name":"resolution: as intended","color":"8d8d8d","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-10T14:44:24Z","updated_at":"2018-09-10T19:37:18Z","closed_at":"2018-09-10T16:14:38Z","author_association":"NONE","body":"Running\r\n\r\n`Dart VM version: 2.0.0 (Fri Aug 3 10:53:23 2018 +0200) on \"windows_x64\"`\r\n\r\nand \r\n\r\n``` \r\nangular:\r\n    dependency: \"direct main\"\r\n    description:\r\n      name: angular\r\n      url: \"https://pub.dartlang.org\"\r\n    source: hosted\r\n    version: \"5.0.0\"\r\n```\r\n\r\n**Issue:** When trying to bootstrap an application with\r\n\r\n`runAppLegacy(AppComponent, createInjectorFromProviders: providers, initReflector: self.initReflector)`, \r\n\r\nif any of the providers in `providers` is a `ClassProvider`, the application startup will fail with the following message on console:\r\n\r\n```\r\ncore.StateError.new {requireMap: {…}, requireModules: Array(1), requireType: \"define\", Symbol(StateError.message): \"Could not find a factory for HelloService. Either a… to a misconfiguration of Bazel or Build Runner).\", Symbol(_error): Error\r\n    at Object.dart.throw (http://localhost:8040/packages/$sdk/dev_compiler/amd/dart_sdk.js:483…}requireMap: {prefix: undefined, name: \"main.dart.bootstrap\", parentMap: null, unnormalized: false, url: \"/main.dart.bootstrap.js\", …}requireModules: [\"main.dart.bootstrap\"]requireType: \"define\"Symbol(StateError.message): \"Could not find a factory for HelloService. Either a provider was not set, *or* AngularDart code generation was never invoked on the depending package (either due to a misconfiguration of Bazel or Build Runner).\"Symbol(_error): Error\r\n    at Object.dart.throw (http://localhost:8040/packages/$sdk/dev_compiler/amd/dart_sdk.js:4834:29)\r\n```\r\n\r\n**Example repo:** https://github.com/szepeshazi/angular5-legacy-bootstrapping\r\n\r\n**Workaround:** replace all `ClassProvider`s with `FactoryProvider`s, and the application will start normally. This is quite confusing as all documentation I found was using `ClassProvider`s when illustrating how to use the legacy bootstrap functions, for example [here](https://github.com/dart-lang/angular/blob/master/angular/CHANGELOG.md) and [here](https://github.com/dart-lang/angular/releases).\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/angular/issues/comments/420034010","html_url":"https://github.com/dart-lang/angular/issues/1608#issuecomment-420034010","issue_url":"https://api.github.com/repos/dart-lang/angular/issues/1608","id":420034010,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDAzNDAxMA==","user":{"login":"szepeshazi","id":691819,"node_id":"MDQ6VXNlcjY5MTgxOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/691819?v=4","gravatar_id":"","url":"https://api.github.com/users/szepeshazi","html_url":"https://github.com/szepeshazi","followers_url":"https://api.github.com/users/szepeshazi/followers","following_url":"https://api.github.com/users/szepeshazi/following{/other_user}","gists_url":"https://api.github.com/users/szepeshazi/gists{/gist_id}","starred_url":"https://api.github.com/users/szepeshazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szepeshazi/subscriptions","organizations_url":"https://api.github.com/users/szepeshazi/orgs","repos_url":"https://api.github.com/users/szepeshazi/repos","events_url":"https://api.github.com/users/szepeshazi/events{/privacy}","received_events_url":"https://api.github.com/users/szepeshazi/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T19:37:18Z","updated_at":"2018-09-10T19:37:18Z","author_association":"NONE","body":"That clears it up. Thanks for the explanation!"}}
{"actor":{"display_login":"szepeshazi"}}