René's URL Explorer Experiment


Title: AoT error with `@Inject` and interface type · Issue #12631 · angular/angular · GitHub

Open Graph Title: AoT error with `@Inject` and interface type · Issue #12631 · angular/angular

X Title: AoT error with `@Inject` and interface type · Issue #12631 · angular/angular

Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/an...

Open Graph Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...

X Description: I'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not su...

Opengraph URL: https://github.com/angular/angular/issues/12631

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AoT error with `@Inject` and interface type","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\n\u003c!-- Describe how the bug manifests. -->\r\n\r\nI have a constructor that uses `@Inject` to get a dependency, and references an interface for that the dep, [`constructor( @Inject(FirebaseApp) _fbApp: firebase.app.App)`](https://github.com/angular/angularfire2/blob/01b04a315053e7a6433e73c552754d9355b12a92/src/auth/firebase_sdk_auth_backend.ts#L30). When I compile the lib with `ngc`, I get this error:\r\n\r\n```\r\nError: angularfire2/src/auth/firebase_sdk_auth_backend.ts:27:1: Error encountered in metadata generated for exported symbol 'FirebaseSdkAuthBackend':\r\n angularfire2/src/auth/firebase_sdk_auth_backend.ts:30:45: Metadata collected contains an error that will be reported at runtime: Expression form not supported.\r\n  {\"__symbolic\":\"error\",\"message\":\"Expression form not supported\",\"line\":29,\"character\":44}\r\n    at angularfire2/node_modules/@angular/tsc-wrapped/src/collector.js:514:27\r\n    at Array.forEach (native)\r\n    at validateMetadata (angularfire2/node_modules/@angular/tsc-wrapped/src/collector.js:502:42)\r\n    at MetadataCollector.getMetadata (angularfire2/node_modules/@angular/tsc-wrapped/src/collector.js:374:17)\r\n    at MetadataWriterHost.writeMetadata (angularfire2/node_modules/@angular/tsc-wrapped/src/compiler_host.js:111:51)\r\n    at MetadataWriterHost.writeFile (angularfire2/node_modules/@angular/tsc-wrapped/src/compiler_host.js:103:19)\r\n    at Object.writeFile (angularfire2/node_modules/typescript/lib/typescript.js:45364:132)\r\n    at Object.writeFile (angularfire2/node_modules/typescript/lib/typescript.js:7597:14)\r\n    at writeEmittedFiles (angularfire2/node_modules/typescript/lib/typescript.js:37854:20)\r\n    at doEmit (angularfire2/node_modules/typescript/lib/typescript.js:37714:17)\r\n```\r\n\r\nIf I change the type to `any`, compilation succeeds.\r\n\r\n**Expected behavior**\r\n\u003c!-- Describe what the behavior would be without the bug. -->\r\n\r\nI would expect to be able to reference an interface in a constructor in conjunction with `@Inject`.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n\u003c!--\r\nIf the current behavior is a bug or you can illustrate your feature request better with an example, \r\nplease provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).\r\n-->\r\n\r\n`ngc` this thing:\r\n\r\n```typescript\r\nimport { NgModule, Inject, Injectable } from '@angular/core';\r\nimport { Http } from '@angular/http';\r\n\r\nexport interface Foo {}\r\n\r\n@Injectable()\r\nexport class MyClass {\r\n  constructor(@Inject(Http) http: Foo) {}\r\n}\r\n\r\n@NgModule({\r\n  providers: [MyClass]\r\n})\r\nexport class MyModule {}\r\n\r\n\r\n```\r\n\r\n* **Angular version:** 2.0.X\r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n`@angular/compiler-cli@2.1.2`\r\n`@angular/core@2.1.2`\r\n\r\n* **Node (for AoT issues):** `node --version` =   \r\n\r\nNode 5.10.1\r\n","author":{"url":"https://github.com/jeffbcross","@type":"Person","name":"jeffbcross"},"datePublished":"2016-10-31T18:52:05Z","url":"https://github.com/angular/angular/issues/12631"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:21086253-1ac7-5405-5f90-35e55d4b769a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEB8A:928E2:667C23:8AE959:6B00D70C
html-safe-noncea24ec1ef455222c962e351d824efe0b469ed1ce55a90f8129123be2f803f81a6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjhBOjkyOEUyOjY2N0MyMzo4QUU5NTk6NkIwMEQ3MEMiLCJ2aXNpdG9yX2lkIjoiMjI5OTQ3Nzg0ODAwMTQwMjYzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac52ca6c727cc88f83edf2fa24022e4840a45b71b6959b4cb5f37bc9eb340c7633
hovercard-subject-tagissue:186366393
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/12631/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6d5d4e818fd51582f7b120d8a9afa7d61eb78d908e61671c213330d0014694d6/angular/angular/issues/12631
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6d5d4e818fd51582f7b120d8a9afa7d61eb78d908e61671c213330d0014694d6/angular/angular/issues/12631
og:image:altI'm submitting a ... (check one with "x") [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejeffbcross
hostnamegithub.com
expected-hostnamegithub.com
Nonea481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release84c8c5cc25e2fb7f2308428458538436baecc6d2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/12631#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F12631
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F12631
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/12631
Reloadhttps://github.com/angular/angular/issues/12631
Reloadhttps://github.com/angular/angular/issues/12631
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests139 (139)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/12631
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/12631
#14894https://github.com/angular/angular/pull/14894
AoT error with @Inject and interface typehttps://github.com/angular/angular/issues/12631#top
#14894https://github.com/angular/angular/pull/14894
https://github.com/chuckjaz
https://github.com/jeffbcross
jeffbcrosshttps://github.com/jeffbcross
on Oct 31, 2016https://github.com/angular/angular/issues/12631#issue-186366393
constructor( @Inject(FirebaseApp) _fbApp: firebase.app.App)https://github.com/angular/angularfire2/blob/01b04a315053e7a6433e73c552754d9355b12a92/src/auth/firebase_sdk_auth_backend.ts#L30
Nexthttps://github.com/angular/angular/issues/12631?timeline_page=1
vicbhttps://github.com/vicb
comp: metadata-extractorhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20metadata-extractor%22
on Oct 31, 2016https://github.com/angular/angular/issues/12631#event-842531231
https://github.com/vicb
vicbhttps://github.com/vicb
on Oct 31, 2016https://github.com/angular/angular/issues/12631#issuecomment-257410797
@chuckjazhttps://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Nov 1, 2016https://github.com/angular/angular/issues/12631#event-842780716
https://github.com/filipesilva
filipesilvahttps://github.com/filipesilva
on Nov 14, 2016https://github.com/angular/angular/issues/12631#issuecomment-260324817
#12860https://github.com/angular/angular/issues/12860
https://github.com/psaussure
psaussurehttps://github.com/psaussure
on Dec 12, 2016https://github.com/angular/angular/issues/12631#issuecomment-266481886
@jeffbcrosshttps://github.com/jeffbcross
https://github.com/ValentinFunk
ValentinFunkhttps://github.com/ValentinFunk
on Dec 14, 2016https://github.com/angular/angular/issues/12631#issuecomment-267026598
https://github.com/mmc41
mmc41https://github.com/mmc41
on Dec 28, 2016https://github.com/angular/angular/issues/12631#issuecomment-269519041
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Dec 28, 2016https://github.com/angular/angular/issues/12631#issuecomment-269521357
https://github.com/mmc41
mmc41https://github.com/mmc41
on Dec 28, 2016https://github.com/angular/angular/issues/12631#issuecomment-269524908
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Dec 28, 2016https://github.com/angular/angular/issues/12631#issuecomment-269525406
https://github.com/mmc41
mmc41https://github.com/mmc41
on Dec 28, 2016https://github.com/angular/angular/issues/12631#issuecomment-269526351
https://github.com/oliverjanik
oliverjanikhttps://github.com/oliverjanik
on Jan 11, 2017https://github.com/angular/angular/issues/12631#issuecomment-271788713
https://github.com/chuckjaz
chuckjazhttps://github.com/chuckjaz
on Jan 11, 2017https://github.com/angular/angular/issues/12631#issuecomment-271937371
https://github.com/itsnotvalid
itsnotvalidhttps://github.com/itsnotvalid
on Jan 18, 2017https://github.com/angular/angular/issues/12631#issuecomment-273403084
https://github.com/Meligy
Meligyhttps://github.com/Meligy
on Jan 21, 2017https://github.com/angular/angular/issues/12631#issuecomment-274260009
#14050https://github.com/angular/angular/issues/14050
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Mar 11, 2017https://github.com/angular/angular/issues/12631#issuecomment-285865032
#14894https://github.com/angular/angular/pull/14894
chuckjazhttps://github.com/chuckjaz
on Mar 14, 2017https://github.com/angular/angular/issues/12631#event-1000041799
fix(compiler): support interface types in injectable constuctorshttps://github.com/chuckjaz/angular/commit/b40ce9b9b30fa154bce9b913b8f41534ed422b63
https://docs.github.com/articles/closing-issues-via-commit-messages
b40ce9bhttps://github.com/chuckjaz/angular/commit/b40ce9b9b30fa154bce9b913b8f41534ed422b63
chuckjazhttps://github.com/chuckjaz
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#14894https://github.com/angular/angular/pull/14894
on Mar 15, 2017https://github.com/angular/angular/issues/12631#event-1001209999
chuckjazhttps://github.com/chuckjaz
on Mar 15, 2017https://github.com/angular/angular/issues/12631#event-1001210647
fix(compiler): support interface types in injectable constuctors (#14894https://github.com/angular/angular/commit/b00fe20afd103f4f5406ab25cbd908a32cce56b3
#14894https://github.com/angular/angular/pull/14894
https://docs.github.com/articles/closing-issues-via-commit-messages
b00fe20https://github.com/angular/angular/commit/b00fe20afd103f4f5406ab25cbd908a32cce56b3
https://github.com/MadUser
MadUserhttps://github.com/MadUser
on Mar 30, 2017https://github.com/angular/angular/issues/12631#issuecomment-290346666
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Mar 30, 2017https://github.com/angular/angular/issues/12631#issuecomment-290347316
@MadUserhttps://github.com/MadUser
https://github.com/mmc41
mmc41https://github.com/mmc41
on Mar 30, 2017https://github.com/angular/angular/issues/12631#issuecomment-290536276
https://github.com/DzmitryShylovich
DzmitryShylovichhttps://github.com/DzmitryShylovich
on Mar 30, 2017https://github.com/angular/angular/issues/12631#issuecomment-290538503
@MadUserhttps://github.com/MadUser
#15640https://github.com/angular/angular/issues/15640
devversionhttps://github.com/devversion
on Apr 24, 2017https://github.com/angular/angular/issues/12631#event-1055127303
fix(ripple): explicit type for global ripple optionshttps://github.com/devversion/material2/commit/71df1e8d5b50329721d1ba5b2c999483bf3cae7e
71df1e8https://github.com/devversion/material2/commit/71df1e8d5b50329721d1ba5b2c999483bf3cae7e
mmalerbahttps://github.com/mmalerba
on Apr 25, 2017https://github.com/angular/angular/issues/12631#event-1057621932
fix(ripple): explicit type for global ripple options (#4240)https://github.com/angular/components/commit/115e901014224fcfee716bfbd39e73d1ac05f577
#4240https://github.com/angular/components/pull/4240
115e901https://github.com/angular/components/commit/115e901014224fcfee716bfbd39e73d1ac05f577
asnowwolfhttps://github.com/asnowwolf
on Aug 11, 2017https://github.com/angular/angular/issues/12631#event-1201913391
fix(compiler): support interface types in injectable constuctors (ang…https://github.com/asnowwolf/angular/commit/b7fe0e912debcc69bf86ed072824e4136f9c4de0
ang…https://github.com/angular/angular/pull/14894
https://docs.github.com/articles/closing-issues-via-commit-messages
b7fe0e9https://github.com/asnowwolf/angular/commit/b7fe0e912debcc69bf86ed072824e4136f9c4de0
juleskremerhttps://github.com/juleskremer
on Aug 28, 2017https://github.com/angular/angular/issues/12631#event-1224652635
fix(compiler): support interface types in injectable constuctors (ang…https://github.com/juleskremer/angular/commit/45d70aede4e1d30171734923282d4ee3e6a3d4c5
ang…https://github.com/angular/angular/pull/14894
https://docs.github.com/articles/closing-issues-via-commit-messages
45d70aehttps://github.com/juleskremer/angular/commit/45d70aede4e1d30171734923282d4ee3e6a3d4c5
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 11, 2019https://github.com/angular/angular/issues/12631#issuecomment-530223824
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 11, 2019https://github.com/angular/angular/issues/12631#event-2624435955
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/12631
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/12631
chuckjazhttps://github.com/chuckjaz
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.