Title: 5.4 breaks @types/node when using isolatedModules · Issue #57136 · microsoft/TypeScript · GitHub
Open Graph Title: 5.4 breaks @types/node when using isolatedModules · Issue #57136 · microsoft/TypeScript
X Title: 5.4 breaks @types/node when using isolatedModules · Issue #57136 · microsoft/TypeScript
Description: 🔎 Search Terms isolatedModules "resolves to a type and must be marked" @types/node export import 🕗 Version & Regression Information This changed between versions 5.3 and 5.4.0-dev.20240120 ⏯ Playground Link No response 💻 Code declare mod...
Open Graph Description: 🔎 Search Terms isolatedModules "resolves to a type and must be marked" @types/node export import 🕗 Version & Regression Information This changed between versions 5.3 and 5.4.0-dev.20240120 ⏯ Playgr...
X Description: 🔎 Search Terms isolatedModules "resolves to a type and must be marked" @types/node export import 🕗 Version & Regression Information This changed between versions 5.3 and 5.4.0-dev.202...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/57136
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"5.4 breaks @types/node when using isolatedModules","articleBody":"### 🔎 Search Terms\r\n\r\nisolatedModules \"resolves to a type and must be marked\" @types/node export import\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 5.3 and 5.4.0-dev.20240120\r\n\r\n\r\n### ⏯ Playground Link\r\n\r\n_No response_\r\n\r\n### 💻 Code\r\n\r\n```ts\r\ndeclare module \"node:events\" {\r\n import events = require(\"events\");\r\n export = events;\r\n}\r\n```\r\nfrom https://unpkg.com/browse/@types/node@20.11.5/events.d.ts (at the end)\r\n\r\n### 🙁 Actual behavior\r\n\r\n```\r\nnode_modules/@types/node/events.d.ts:878:14 - error TS1291: 'events' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'events' is imported.\r\n\r\n878 export = events;\r\n ~~~~~~\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\nIt should work, as `events` is not just a type but also a value\r\n\r\n### Additional information about the issue\r\n\r\nDT discussion: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/68285\r\n\r\nOriginally found at https://github.com/babel/babel/pull/16222","author":{"url":"https://github.com/nicolo-ribaudo","@type":"Person","name":"nicolo-ribaudo"},"datePublished":"2024-01-23T10:13:31Z","url":"https://github.com/microsoft/TypeScript/issues/57136"}
| 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:f0fd3d90-b4eb-3034-a3e7-0497d2f3aaff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C736:3A73AA:5D36CE:75D18E:6B01122C |
| html-safe-nonce | 7d839ce86ca9e357e1d944d5343c1dd0aa3cdbc4135fae7eedc7b57cbff1f26b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzM2OjNBNzNBQTo1RDM2Q0U6NzVEMThFOjZCMDExMjJDIiwidmlzaXRvcl9pZCI6IjMzOTQ5MDkyMzEwNzY0MTM5OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 76f743e11f7a94ce1dde859aa0055739226a86a60cd8b702dce0b04f3288de88 |
| hovercard-subject-tag | issue:2095725162 |
| 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/57136/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b52a5ff1dea5fdd1d74ca9806c9c8bc40f0f23d158e5c9c3e60853a4ae845cc/microsoft/TypeScript/issues/57136 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b52a5ff1dea5fdd1d74ca9806c9c8bc40f0f23d158e5c9c3e60853a4ae845cc/microsoft/TypeScript/issues/57136 |
| og:image:alt | 🔎 Search Terms isolatedModules "resolves to a type and must be marked" @types/node export import 🕗 Version & Regression Information This changed between versions 5.3 and 5.4.0-dev.20240120 ⏯ Playgr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicolo-ribaudo |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width