Title: Package.json conditional exports points to non-existent files · Issue #163 · developit/unfetch · GitHub
Open Graph Title: Package.json conditional exports points to non-existent files · Issue #163 · developit/unfetch
X Title: Package.json conditional exports points to non-existent files · Issue #163 · developit/unfetch
Description: The conditional exports in package.json points to files which does not exist: unfetch/package.json Lines 16 to 20 in ee5810e "exports": { ".": { "import": "./index.mjs", "default": "./index.js" }, This causes the following errors when im...
Open Graph Description: The conditional exports in package.json points to files which does not exist: unfetch/package.json Lines 16 to 20 in ee5810e "exports": { ".": { "import": "./index.mjs", "default": "./index.js" }, ...
X Description: The conditional exports in package.json points to files which does not exist: unfetch/package.json Lines 16 to 20 in ee5810e "exports": { ".": { "import": "./inde...
Opengraph URL: https://github.com/developit/unfetch/issues/163
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Package.json conditional exports points to non-existent files","articleBody":"The conditional exports in package.json points to files which does not exist:\r\n\r\nhttps://github.com/developit/unfetch/blob/ee5810e7f9cd769677984b159d7e250adf4611b9/package.json#L16-L20\r\n\r\nThis causes the following errors when importing `unfetch` with typescript:\r\n\r\n```\r\nCannot find module 'unfetch' or its corresponding type declarations.ts(2307)\r\n```\r\n\r\nAlso, if you're declaring conditional exports and have type declarations (d.ts) in different location, I think you need to add **\"types\"** as the first export condition (see: https://www.typescriptlang.org/docs/handbook/esm-node.html, and https://github.com/microsoft/TypeScript/issues/48235)\r\n\r\nTherefore, I believe the correct exports should've been:\r\n```json\r\n \"exports\": {\r\n \".\": {\r\n \"types\": \"./src/index.d.ts\",\r\n \"import\": \"./dist/unfetch.mjs\",\r\n \"default\": \"./dist/unfetch.js\"\r\n },\r\n```\r\n\r\n---\r\nFWIW, I'm using `Typescript 4.9` with `moduleResolution\": \"NodeNext\"`","author":{"url":"https://github.com/IronGeek","@type":"Person","name":"IronGeek"},"datePublished":"2023-02-05T09:08:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/163/unfetch/issues/163"}
| 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:799b3217-7469-2a2e-1f7e-09dc3d5a6ed7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C78E:2938DD:364ABD6:4817F9E:6964B253 |
| html-safe-nonce | 9e7212d9466a7776350475cb9539d51b1e025a06d6c7f2414c852275a7cdd21f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzhFOjI5MzhERDozNjRBQkQ2OjQ4MTdGOUU6Njk2NEIyNTMiLCJ2aXNpdG9yX2lkIjoiNDY3MjU2Mjk3MjU0ODQ0NDc1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5add0749db220e2820268797ff741f19935953342f67f2f0af8b1b1311135664 |
| hovercard-subject-tag | issue:1571355284 |
| 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/developit/unfetch/163/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d48312889b356a963dbcc6937bfa5156dd5607814636cfcc0c50c174eb3dfb67/developit/unfetch/issues/163 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d48312889b356a963dbcc6937bfa5156dd5607814636cfcc0c50c174eb3dfb67/developit/unfetch/issues/163 |
| og:image:alt | The conditional exports in package.json points to files which does not exist: unfetch/package.json Lines 16 to 20 in ee5810e "exports": { ".": { "import": "./index.mjs", "default": "./index.js" }, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | IronGeek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 15579c46431b7fd25941c3b09010f74fd1890c7a35226839bbbf40ce70fb3057 |
| turbo-cache-control | no-preview |
| go-import | github.com/developit/unfetch git https://github.com/developit/unfetch.git |
| octolytics-dimension-user_id | 105127 |
| octolytics-dimension-user_login | developit |
| octolytics-dimension-repository_id | 82766832 |
| octolytics-dimension-repository_nwo | developit/unfetch |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 82766832 |
| octolytics-dimension-repository_network_root_nwo | developit/unfetch |
| 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 | 499abb347cb197601d399c346cfeb4b3fa135d5c |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width