Title: Module resolution using nodenext and a wildcard in package.json exports · Issue #55021 · microsoft/TypeScript · GitHub
Open Graph Title: Module resolution using nodenext and a wildcard in package.json exports · Issue #55021 · microsoft/TypeScript
X Title: Module resolution using nodenext and a wildcard in package.json exports · Issue #55021 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms Nodenext wildcard, type cannot be named 🕗 Version & Regression Information The bug only appears when using nodenext for module resolution ⏯ Playground Link Cloneable repo: https://github.com/geoffreytools/effect...
Open Graph Description: Bug Report 🔎 Search Terms Nodenext wildcard, type cannot be named 🕗 Version & Regression Information The bug only appears when using nodenext for module resolution ⏯ Playground Link Cloneable repo:...
X Description: Bug Report 🔎 Search Terms Nodenext wildcard, type cannot be named 🕗 Version & Regression Information The bug only appears when using nodenext for module resolution ⏯ Playground Link Cloneable r...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/55021
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Module resolution using nodenext and a wildcard in package.json exports","articleBody":"# Bug Report\r\n\r\n\u003c!--\r\n Please fill in each section completely. Thank you!\r\n-->\r\n\r\n### 🔎 Search Terms\r\n\r\nNodenext wildcard, type cannot be named\r\n\r\n### 🕗 Version & Regression Information\r\nThe bug only appears when using nodenext for module resolution\r\n\r\n### ⏯ Playground Link\r\n\r\nCloneable repo: https://github.com/geoffreytools/effect-test-tsc\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nimport { TaggedClass } from '@effect/data/Data';\r\n// import '@effect/data/Equal';\r\n\r\nexport class Foo extends TaggedClass('Foo')\u003c{}> {}\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\n```\r\nThe inferred type of 'Foo' cannot be named without a reference to '../node_modules/@effect/data/Equal'. This is likely not portable. A type annotation is necessary.\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\nTo compile correctly, without using nodenext it works fine and the same issue doesn't apply to other transitive imports such as Hash that are identically exported. All goes away the very moment there is either an explicit import of `Equal` or when adding to the library package.json the following:\r\n\r\n```ts\r\n{\r\n \"exports\": {\r\n \"./Equal\": {\r\n \"import\": {\r\n \"types\": \"./Equal.d.ts\",\r\n \"default\": \"./mjs/Equal.mjs\"\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nNote that the library uses a wildcard `./*` as each import map to a file and this is perfectly resolvable by node\r\n","author":{"url":"https://github.com/mikearnaldi","@type":"Person","name":"mikearnaldi"},"datePublished":"2023-07-14T14:02:44Z","url":"https://github.com/microsoft/TypeScript/issues/55021"}
| 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:6c23bd36-f83c-bff5-3774-ddc589d7f9be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F8C:2EA7B6:104A33E:1559490:6B04F2D6 |
| html-safe-nonce | 605f37948c3230c00c3d29e84e900e827e493c6daeb4d11742e49a530a4518b8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjhDOjJFQTdCNjoxMDRBMzNFOjE1NTk0OTA6NkIwNEYyRDYiLCJ2aXNpdG9yX2lkIjoiMjk1NzczNjkzNDMzNjcyNDA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2a79d8533ac87e13c1dba81b7dae5def69419dc584bfaff1e41f97e390403f62 |
| hovercard-subject-tag | issue:1804940793 |
| 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/55021/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc83cdeb417e97734ee91ba24a3c9b83f4def0d8d392309acd04304af358652d/microsoft/TypeScript/issues/55021 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc83cdeb417e97734ee91ba24a3c9b83f4def0d8d392309acd04304af358652d/microsoft/TypeScript/issues/55021 |
| og:image:alt | Bug Report 🔎 Search Terms Nodenext wildcard, type cannot be named 🕗 Version & Regression Information The bug only appears when using nodenext for module resolution ⏯ Playground Link Cloneable repo:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mikearnaldi |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0ff704de2671f716381d0ef36115cddb81606dd5397a5b003230bb8c02d623b |
| 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 | cbe60d43d23e17438879ed212ad20068394651c4 |
| 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