Title: Printing JS constructor function type causes out-of-memory error · Issue #29597 · microsoft/TypeScript · GitHub
Open Graph Title: Printing JS constructor function type causes out-of-memory error · Issue #29597 · microsoft/TypeScript
X Title: Printing JS constructor function type causes out-of-memory error · Issue #29597 · microsoft/TypeScript
Description: TypeScript Version: 3.2.2 and 3.3.0-rc Search Terms: heap out of memory Code First of all, I don't expect there to be a valid use case of what I'm describing below. In fact a miss configuration in my build settings lead me to this. Howev...
Open Graph Description: TypeScript Version: 3.2.2 and 3.3.0-rc Search Terms: heap out of memory Code First of all, I don't expect there to be a valid use case of what I'm describing below. In fact a miss configuration in ...
X Description: TypeScript Version: 3.2.2 and 3.3.0-rc Search Terms: heap out of memory Code First of all, I don't expect there to be a valid use case of what I'm describing below. In fact a miss configura...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/29597
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Printing JS constructor function type causes out-of-memory error","articleBody":"\u003c!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨\r\n\r\nHalf of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common \"Bugs\" That Aren't Bugs section!\r\n\r\nPlease help us by doing the following steps before logging an issue:\r\n * Search: https://github.com/Microsoft/TypeScript/search?type=Issues\r\n * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ\r\n\r\nPlease fill in the *entire* template below.\r\n-->\r\n\r\n\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.2.2 and 3.3.0-rc\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\nheap out of memory\r\n\r\n**Code**\r\nFirst of all, I don't expect there to be a valid use case of what I'm describing below. In fact a miss configuration in my build settings lead me to this. However I don't expect TSC to completely crash. Also I found that TS 3.1 had no problems with the code below so this might be a regression of TS 3.2.\r\n\r\nSteps to reproduce the heap OOM\r\n* npm install [chart.js](https://github.com/chartjs/Chart.js)\r\n* cd into `node_modules/chart.js/dist`. You should find `Chart.min.js` there.\r\n* create a `tsconfig.json` with the following content\r\n```\r\n{\r\n \"compilerOptions\": {\r\n \"target\": \"es5\",\r\n \"module\": \"commonjs\",\r\n \"downlevelIteration\": true,\r\n \"skipDefaultLibCheck\": true,\r\n \"moduleResolution\": \"node\",\r\n \"preserveConstEnums\": false,\r\n \"experimentalDecorators\": true,\r\n \"emitDecoratorMetadata\": true,\r\n \"jsx\": \"react\",\r\n \"noErrorTruncation\": true,\r\n \"noEmitOnError\": false,\r\n \"declaration\": false,\r\n \"stripInternal\": true,\r\n \"inlineSourceMap\": true,\r\n \"inlineSources\": true,\r\n \"sourceMap\": false,\r\n \"jsxFactory\": \"react\",\r\n \"noImplicitAny\": true,\r\n \"noImplicitReturns\": true,\r\n \"noImplicitThis\": true,\r\n \"noFallthroughCasesInSwitch\": true,\r\n \"strictNullChecks\": true,\r\n \"strictPropertyInitialization\": true,\r\n \"strictFunctionTypes\": true,\r\n \"noStrictGenericChecks\": true,\r\n \"noResolve\": true,\r\n \"types\": [],\r\n \"importHelpers\": false,\r\n \"allowJs\": true,\r\n \"checkJs\": false\r\n },\r\n \"files\": [\r\n \"./Chart.min.js\",\r\n ],\r\n \"compileOnSave\": false\r\n}\r\n```\r\n* run `tsc -p tsconfig.json --outDir foo` and see the JavaScript heap out of memory thrown.\r\n\r\n**Expected behavior:**\r\nEmits a file `foo/Chart.min.js`.\r\nTS 3.1.6 finishes this in 1.7 seconds without any errors.\r\n\r\n**Actual behavior:**\r\n`FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory`\r\n\r\n**Playground Link:** \u003c!-- A link to a TypeScript Playground \"Share\" link which demonstrates this behavior -->\r\nN/A\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\nThis looks similar to https://github.com/Microsoft/TypeScript/issues/29326 and https://github.com/Microsoft/TypeScript/issues/29511 but I don't understand it deep enough to tell if it's a duplicate.","author":{"url":"https://github.com/bowenni","@type":"Person","name":"bowenni"},"datePublished":"2019-01-26T01:33:59Z","url":"https://github.com/microsoft/TypeScript/issues/29597"}
| 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:4732c96b-c57c-0bef-f74a-b2dcd635d18c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1DE:31E99C:237A6EF:2F5B7C6:6B019527 |
| html-safe-nonce | 2f25d18a876f80e228b0b9e2986d08c5a822579f6725a67af095a87c56a58c7b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMURFOjMxRTk5QzoyMzdBNkVGOjJGNUI3QzY6NkIwMTk1MjciLCJ2aXNpdG9yX2lkIjoiMzY1MjQ3NjQzMTI0NzcwOTQ3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b57c9a388186c09022e5e3c9dc191dd37fc344c40af4fcfe84f7ccc758d2173d |
| hovercard-subject-tag | issue:403390772 |
| 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/29597/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e8d96a3293122c5f992079ae0165bd295f2519a0e0db96777292806508def74f/microsoft/TypeScript/issues/29597 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e8d96a3293122c5f992079ae0165bd295f2519a0e0db96777292806508def74f/microsoft/TypeScript/issues/29597 |
| og:image:alt | TypeScript Version: 3.2.2 and 3.3.0-rc Search Terms: heap out of memory Code First of all, I don't expect there to be a valid use case of what I'm describing below. In fact a miss configuration in ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bowenni |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width