Title: `Object` variable declaration conflicts on commonjs · Issue #35478 · microsoft/TypeScript · GitHub
Open Graph Title: `Object` variable declaration conflicts on commonjs · Issue #35478 · microsoft/TypeScript
X Title: `Object` variable declaration conflicts on commonjs · Issue #35478 · microsoft/TypeScript
Description: TypeScript Version: 3.7.x-dev.20191203 Search Terms: Code export default {} const Object = {}; Expected behavior: "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); { exports.default = {}; const Object = {}; } n...
Open Graph Description: TypeScript Version: 3.7.x-dev.20191203 Search Terms: Code export default {} const Object = {}; Expected behavior: "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); { expo...
X Description: TypeScript Version: 3.7.x-dev.20191203 Search Terms: Code export default {} const Object = {}; Expected behavior: "use strict"; Object.defineProperty(exports, "__esModule", { va...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/35478
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Object` variable declaration conflicts on commonjs","articleBody":"**TypeScript Version:** 3.7.x-dev.20191203\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\n\r\n**Code**\r\n\r\n```ts\r\nexport default {}\r\nconst Object = {};\r\n```\r\n\r\n**Expected behavior:**\r\n```js\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n{\r\nexports.default = {};\r\nconst Object = {};\r\n}\r\n```\r\nno error\r\n\r\n**Actual behavior:**\r\n```js\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.default = {};\r\nconst Object = {};\r\n```\r\n```\r\nVM69:2 Uncaught ReferenceError: Cannot access 'Object' before initialization\r\n at eval (eval at \u003canonymous> (main-3.js:1239), \u003canonymous>:2:1)\r\n at main-3.js:1239\r\n```\r\n**Playground Link:** http://www.typescriptlang.org/play/index.html?module=1#code/KYDwDg9gTgLgBAE2AMwIYFcA28DeBfAKAGMIA7AZ3gHkAjAK2CPgF458BuIA\r\n\r\n**Related Issues:** \u003c!-- Did you find other bugs that looked similar? -->\r\n","author":{"url":"https://github.com/falsandtru","@type":"Person","name":"falsandtru"},"datePublished":"2019-12-03T20:52:10Z","url":"https://github.com/microsoft/TypeScript/issues/35478"}
| 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:fe8fc744-e58c-1fa6-36c0-7a5049275bf0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8742:245336:615DD6:851AC2:6B04757E |
| html-safe-nonce | 2cd32dbaa5f4a654868e3e0f37aa2266e34d439ae1b29296d858c19ad083d270 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzQyOjI0NTMzNjo2MTVERDY6ODUxQUMyOjZCMDQ3NTdFIiwidmlzaXRvcl9pZCI6IjU2NTEyMTI0MjEwNTA5NTUxMzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 23c016c13044aff130ba198cc1417018665c0d17bf9f67fe305e08c71a365966 |
| hovercard-subject-tag | issue:532258243 |
| 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/35478/issue_layout |
| twitter:image | https://opengraph.githubassets.com/adb2a97159f2619b8a96ad47681097ab5d5ceed73dbd5aad8bb5cfebdaf7bdf2/microsoft/TypeScript/issues/35478 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/adb2a97159f2619b8a96ad47681097ab5d5ceed73dbd5aad8bb5cfebdaf7bdf2/microsoft/TypeScript/issues/35478 |
| og:image:alt | TypeScript Version: 3.7.x-dev.20191203 Search Terms: Code export default {} const Object = {}; Expected behavior: "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); { expo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | falsandtru |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| 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