Title: Emit of require calls is invalid · Issue #9538 · microsoft/TypeScript · GitHub
Open Graph Title: Emit of require calls is invalid · Issue #9538 · microsoft/TypeScript
X Title: Emit of require calls is invalid · Issue #9538 · microsoft/TypeScript
Description: TypeScript Version: nightly (2.0.0-dev.20160705) Code target: es6 , module: commonjs , moduleResolution: node (tried target=es5 moduleResolution=classic as well) File A (index.ts): import * as TestModule from './test.ts'; let obj = new T...
Open Graph Description: TypeScript Version: nightly (2.0.0-dev.20160705) Code target: es6 , module: commonjs , moduleResolution: node (tried target=es5 moduleResolution=classic as well) File A (index.ts): import * as Test...
X Description: TypeScript Version: nightly (2.0.0-dev.20160705) Code target: es6 , module: commonjs , moduleResolution: node (tried target=es5 moduleResolution=classic as well) File A (index.ts): import * as Test...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/9538
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Emit of require calls is invalid","articleBody":"\u003c!-- BUGS: Please use this template. -->\n\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\n\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\n\n**TypeScript Version:** nightly (2.0.0-dev.20160705)\n\n**Code**\n\ntarget: es6 , module: commonjs , moduleResolution: node\n(tried target=es5 moduleResolution=classic as well)\n\n``` ts\nFile A (index.ts):\n\nimport * as TestModule from './test.ts';\nlet obj = new TestModule.Test();\n\nFile B (test.ts):\nexport class Test {}\n\n```\n\n**Expected behavior:**\n\nEmitted index.js file should have:\n\n``` ts\nconst TestModule = require('./test.js');\n```\n\n**Actual behavior:** \n\nEmited index.js file wrongly points at .ts file causing runtime module not found error.\n\n``` ts\nconst TestModule = require('./test.ts')\n```\n\nI've searched internet and looked towards BC changes in TypeScript but couldn find anything on this topic. I am 100% sure it changed extensions from .ts to .js in the earlier versions of TypeScript (around 1.5 or so).\n","author":{"url":"https://github.com/nullptr128","@type":"Person","name":"nullptr128"},"datePublished":"2016-07-06T18:56:50Z","url":"https://github.com/microsoft/TypeScript/issues/9538"}
| 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:e6f8e47c-5256-471a-3a4a-efc9485d2f22 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E95C:B6E5D:460A1E:5DDB41:6B04A161 |
| html-safe-nonce | 177421f86009773286a34f6f9e43f4046e8060fc7a3622406410f197718a1cbf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTVDOkI2RTVEOjQ2MEExRTo1RERCNDE6NkIwNEExNjEiLCJ2aXNpdG9yX2lkIjoiMjkyNzU4NDI5MzU0OTI4NTcyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 29e81f25f2cb93041dfa4de29d5547c039f05427e0ce6c7953b8091d6ab8e4af |
| hovercard-subject-tag | issue:164148802 |
| 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/9538/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad1ed9ed3a16e3674b96aa39443cc625bd4d708308d9e602288f7a7659c01b65/microsoft/TypeScript/issues/9538 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad1ed9ed3a16e3674b96aa39443cc625bd4d708308d9e602288f7a7659c01b65/microsoft/TypeScript/issues/9538 |
| og:image:alt | TypeScript Version: nightly (2.0.0-dev.20160705) Code target: es6 , module: commonjs , moduleResolution: node (tried target=es5 moduleResolution=classic as well) File A (index.ts): import * as Test... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nullptr128 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width