Title: Compile error using TypeScript "ReturnType" · Issue #24499 · angular/angular · GitHub
Open Graph Title: Compile error using TypeScript "ReturnType" · Issue #24499 · angular/angular
X Title: Compile error using TypeScript "ReturnType" · Issue #24499 · angular/angular
Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submi...
Open Graph Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...
X Description: I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or reques...
Opengraph URL: https://github.com/angular/angular/issues/24499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Compile error using TypeScript \"ReturnType\"","articleBody":"## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[ ] Documentation issue or 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[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\nCreate a brand new Angular app. Open in VS Code. Compiles and works fine. Add the following legal TypeScript to a new .ts file in the app folder.\r\n\r\n const f = () => 'abc';\r\n type T = ReturnType\u003ctypeof f>;\r\n\r\nRun `npm build`. Error I receive is `error TS2304: Cannot find name 'ReturnType'. Works fine in an old create-react-app project. The VS Code editor is happy with the code (no red squigglies) but the build process isn't. The status bar shows using TypeScript 2.91.\r\n\r\n## Expected behavior\r\n\r\nNo build error.\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\r\nng new ang-app\r\ncd ang-app\r\nng serve --open\r\n\r\nVS Code 1.24\r\nOpen folder ang-app\r\nRun build task - no problems\r\n\r\nIn the app folder, add a file rt.ts with code as shown above\r\nnpm build\r\nError as described above\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n\r\nReturnType is useful for generating strongly-typed actions (like Redux) with less boilerplate.\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 6.03 \r\n\u003c!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\nn/a\r\n \r\nFor Tooling issues:\r\n- Node version: 5.60\r\n- Platform: Windows 10\r\n- VS Code 1.24\r\n\r\nOthers:\r\n\u003c!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... -->\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/jmagaram","@type":"Person","name":"jmagaram"},"datePublished":"2018-06-14T07:36:39Z","url":"https://github.com/angular/angular/issues/24499"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:727c580b-5f04-f972-7141-8cc86fba7f95 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F52:364B55:834C71:ABE33B:6B00D9F2 |
| html-safe-nonce | db39b640317d9f44267fc83c7c8460e256a72853c1498a69b708782893984d47 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjUyOjM2NEI1NTo4MzRDNzE6QUJFMzNCOjZCMDBEOUYyIiwidmlzaXRvcl9pZCI6IjkwMDkyOTU5MDQ5NTEyOTQ0NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2f8e64c6d2bcfa0b296a9ccc76affdfca4a08bbfe8f5e77054f88ddc89d269ea |
| hovercard-subject-tag | issue:332284571 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/24499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a903adb7917a8cf4d8be13f151fcd36559ea65dddda6cddeaf6df5331174a229/angular/angular/issues/24499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a903adb7917a8cf4d8be13f151fcd36559ea65dddda6cddeaf6df5331174a229/angular/angular/issues/24499 |
| og:image:alt | I'm submitting a... [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmagaram |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width