Title: `types` and `exports` in dependency package.json break module specifier generation · Issue #46281 · microsoft/TypeScript · GitHub
Open Graph Title: `types` and `exports` in dependency package.json break module specifier generation · Issue #46281 · microsoft/TypeScript
X Title: `types` and `exports` in dependency package.json break module specifier generation · Issue #46281 · microsoft/TypeScript
Description: #46159 seems to cause us to ignore the top-level types field when there’s an exports field when trying to see if we can resolve a node_modules path to a package-style module specifier. Complete failing fourslash test: // @module: commonj...
Open Graph Description: #46159 seems to cause us to ignore the top-level types field when there’s an exports field when trying to see if we can resolve a node_modules path to a package-style module specifier. Complete fai...
X Description: #46159 seems to cause us to ignore the top-level types field when there’s an exports field when trying to see if we can resolve a node_modules path to a package-style module specifier. Complete fai...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/46281
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`types` and `exports` in dependency package.json break module specifier generation","articleBody":"#46159 seems to cause us to ignore the top-level `types` field when there’s an `exports` field when trying to see if we can resolve a node_modules path to a package-style module specifier. Complete failing fourslash test:\r\n\r\n```ts\r\n// @module: commonjs\r\n\r\n// @Filename: /node_modules/react-hook-form/package.json\r\n//// {\r\n//// \"name\": \"react-hook-form\",\r\n//// \"main\": \"dist/index.cjs.js\",\r\n//// \"module\": \"dist/index.esm.js\",\r\n//// \"types\": \"dist/index.d.ts\",\r\n//// \"exports\": {\r\n//// \"./package.json\": \"./package.json\",\r\n//// \".\": {\r\n//// \"import\": \"./dist/index.esm.js\",\r\n//// \"require\": \"./dist/index.cjs.js\"\r\n//// }\r\n//// }\r\n//// }\r\n\r\n// @Filename: /node_modules/react-hook-form/dist/index.cjs.js\r\n//// module.exports = {};\r\n\r\n// @Filename: /node_modules/react-hook-form/dist/index.esm.js\r\n//// export function useForm() {}\r\n\r\n// @Filename: /node_modules/react-hook-form/dist/index.d.ts\r\n//// export function useForm(): any;\r\n\r\n// @Filename: /index.ts\r\n//// useForm/**/\r\n\r\nverify.importFixModuleSpecifiers(\"\", [\"react-hook-form\"]);\r\n```","author":{"url":"https://github.com/andrewbranch","@type":"Person","name":"andrewbranch"},"datePublished":"2021-10-08T21:56:06Z","url":"https://github.com/microsoft/TypeScript/issues/46281"}
| 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:156a0c21-f288-8d0a-1f1d-bd8b39fc9f96 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C556:A99C2:F3C68D:13942F0:6B00FB84 |
| html-safe-nonce | 99c9f4f2e76aec5502abbe999cc07bbf488b37a635041d01543c13519cecd7e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTU2OkE5OUMyOkYzQzY4RDoxMzk0MkYwOjZCMDBGQjg0IiwidmlzaXRvcl9pZCI6IjQyMjkyOTA1NjkxNjUyNDEyMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 51ad39fbf1cb2a9f475b8aed5018593287d65916d03dd0cccb548b80939b85ef |
| hovercard-subject-tag | issue:1021497167 |
| 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/46281/issue_layout |
| twitter:image | https://opengraph.githubassets.com/467a5cd06cb94eafb7e5fe8808fd57f4a1c11631a20cf0764c0d7abe632d984c/microsoft/TypeScript/issues/46281 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/467a5cd06cb94eafb7e5fe8808fd57f4a1c11631a20cf0764c0d7abe632d984c/microsoft/TypeScript/issues/46281 |
| og:image:alt | #46159 seems to cause us to ignore the top-level types field when there’s an exports field when trying to see if we can resolve a node_modules path to a package-style module specifier. Complete fai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewbranch |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width