Title: Generated async / await code is missing require statement · Issue #5998 · microsoft/TypeScript · GitHub
Open Graph Title: Generated async / await code is missing require statement · Issue #5998 · microsoft/TypeScript
X Title: Generated async / await code is missing require statement · Issue #5998 · microsoft/TypeScript
Description: The generated JS code is missing a dependency onto the references promise implementation. Steps to reproduce: install bluebird promises create the following bluebird.d.ts. declare module 'bluebird' { interface Promise
Open Graph Description: The generated JS code is missing a dependency onto the references promise implementation. Steps to reproduce: install bluebird promises create the following bluebird.d.ts. declare module 'bluebird'...
X Description: The generated JS code is missing a dependency onto the references promise implementation. Steps to reproduce: install bluebird promises create the following bluebird.d.ts. declare module 'blueb...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/5998
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generated async / await code is missing require statement","articleBody":"The generated JS code is missing a dependency onto the references promise implementation. Steps to reproduce:\n- install bluebird promises\n- create the following bluebird.d.ts.\n\n``` typescript\ndeclare module 'bluebird' {\n interface Promise\u003cT> {\n then\u003cU>(onFulfilled: (value: T) => U, onRejected: (reason: any) => U): Promise\u003cT>;\n }\n\n var Promise: {\n new\u003cT>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): Promise\u003cT>;\n } \n}\n```\n- create a test file\n\n``` typescript\nimport * as bluebird from 'bluebird';\n\nasync function firstName(): bluebird.Promise\u003cstring> {\n return \"Dirk\";\n}\n\nasync function lastName(): Promise\u003cstring> {\n return \"Baeumer\";\n}\n\nasync function use() {\n var first = await firstName();\n var last = await lastName();\n return `${first} ${last}`;\n}\n\nif (require.main === module) {\n var p = use();\n p.then((value) => console.log(value));\n}\n```\n- compile and run.\n\nObserve: you get an exception. Problem is that the generated code is missing a \n\n``` typescript\nvar bluebird = require('bluebird');\n```\n\nstatement.\n","author":{"url":"https://github.com/dbaeumer","@type":"Person","name":"dbaeumer"},"datePublished":"2015-12-08T19:34:11Z","url":"https://github.com/microsoft/TypeScript/issues/5998"}
| 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:7f06cea5-31e0-e79c-6d5c-b201d86fe0dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B16E:11486D:763088:9B36DF:6B00D781 |
| html-safe-nonce | f2a303e0f27bcc5980df83982b7612243759a1cd6f6f87072c8acf45c806892b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTZFOjExNDg2RDo3NjMwODg6OUIzNkRGOjZCMDBENzgxIiwidmlzaXRvcl9pZCI6Ijc4NjQ1NjU4NjUwNTA1OTMxNTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4276465519913f22c2f403a84b921aba88f9dcdd08268eae768b70ca66e8ade8 |
| hovercard-subject-tag | issue:121081608 |
| 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/microsoft/TypeScript/5998/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d60fccf7439148c13dc772b14f2c1caa96e173dd89600bc7de4eb06d3ed2ec4d/microsoft/TypeScript/issues/5998 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d60fccf7439148c13dc772b14f2c1caa96e173dd89600bc7de4eb06d3ed2ec4d/microsoft/TypeScript/issues/5998 |
| og:image:alt | The generated JS code is missing a dependency onto the references promise implementation. Steps to reproduce: install bluebird promises create the following bluebird.d.ts. declare module 'bluebird'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dbaeumer |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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 | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width