Title: Auto imports not working for modules exported via `exports` in package.json · Issue #46339 · microsoft/TypeScript · GitHub
Open Graph Title: Auto imports not working for modules exported via `exports` in package.json · Issue #46339 · microsoft/TypeScript
X Title: Auto imports not working for modules exported via `exports` in package.json · Issue #46339 · microsoft/TypeScript
Description: Bug Report Auto import not working as expected for modules that use the exports field and type: module in package.json. Relevant PR that introduced exports support: #44501 🕗 Version & Regression Information Occurs in 4.5.0-dev.20211012 a...
Open Graph Description: Bug Report Auto import not working as expected for modules that use the exports field and type: module in package.json. Relevant PR that introduced exports support: #44501 🕗 Version & Regression In...
X Description: Bug Report Auto import not working as expected for modules that use the exports field and type: module in package.json. Relevant PR that introduced exports support: #44501 🕗 Version & Regressio...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/46339
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Auto imports not working for modules exported via `exports` in package.json","articleBody":"# Bug Report\r\n\r\nAuto import not working as expected for modules that use the `exports` field and `type: module` in package.json. \r\n\r\nRelevant PR that introduced `exports` support: https://github.com/microsoft/TypeScript/pull/44501\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nOccurs in `4.5.0-dev.20211012` and `4.5.0-beta`.\r\n\r\n### ⏯ Playground Link\r\n\r\nIt's a bit hard to reproduce in the playground, so I've created a repository here https://github.com/renke/typescript-4.5-beta-exports – The README contains some instructions on how to reproduce it. It also describes another bug that was already filed here https://github.com/microsoft/TypeScript/issues/46333 so it can probably be ignored.\r\n\r\n### 🙁 Actual behavior\r\n\r\nAuto import doesn't work for non-root exported modules (unless they are already imported elsewhere). \r\n\r\nAlso, `./*` exports can not be imported at all. \r\n\r\nRunning the modules via `node` works, so the `exports` configuration should be valid.\r\n\r\n### 🙂 Expected behavior\r\n\r\nAuto import should work for all modules explicitly exported via `exports` when the exporting package is listed in `dependencies` (as in https://github.com/microsoft/TypeScript/pull/38923).\r\n\r\nAlso, import (and auto import) should work for `./*` exports. Unclear if this would lead to performance problems for auto import, but I think this should be supported.\r\n","author":{"url":"https://github.com/renke","@type":"Person","name":"renke"},"datePublished":"2021-10-13T08:50:43Z","url":"https://github.com/microsoft/TypeScript/issues/46339"}
| 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:f80add59-f21c-bd5a-5ea0-2ac31fbb8eae |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C46E:1CEA6F:8F763B:BF96AA:6B00E12F |
| html-safe-nonce | 8282a3ce6253d34fff810ea04c3ba85d4cf6191310c86cd18919ccc74cce7ddc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDZFOjFDRUE2Rjo4Rjc2M0I6QkY5NkFBOjZCMDBFMTJGIiwidmlzaXRvcl9pZCI6Ijc1MTc0OTk1OTUxOTk0MDYzODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 14783bb7ec6a38cf4c8e4881e1d8828cf0d5ec9d75b2c7cdd15f9aad8adca1ab |
| hovercard-subject-tag | issue:1024969820 |
| 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/46339/issue_layout |
| twitter:image | https://opengraph.githubassets.com/461b23fca6a0670dfe87f4a1db28094035d0cad917d8ae9fc27be20be77fbfac/microsoft/TypeScript/issues/46339 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/461b23fca6a0670dfe87f4a1db28094035d0cad917d8ae9fc27be20be77fbfac/microsoft/TypeScript/issues/46339 |
| og:image:alt | Bug Report Auto import not working as expected for modules that use the exports field and type: module in package.json. Relevant PR that introduced exports support: #44501 🕗 Version & Regression In... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | renke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width