Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Types not working on import #103

Closed
SevYote opened this issue Jun 17, 2023 · 10 comments
Closed

Types not working on import #103

SevYote opened this issue Jun 17, 2023 · 10 comments
Labels

Comments

@SevYote
Copy link

SevYote commented Jun 17, 2023

Heya, ran into some issues trying out honeycomb-grid where imports didn't seem to be working right, which ultimately lead me to this thread.

I used patch-package to patch [email protected] as shown in the diff below. That got me going, but I'm not sure if that's actually the proper / ideal way to do it. Hopefully it gets you down the right path to a fix, though. This site from that thread gives some more info.

diff --git a/node_modules/honeycomb-grid/package.json b/node_modules/honeycomb-grid/package.json
index 5f36957..c0f71dd 100644
--- a/node_modules/honeycomb-grid/package.json
+++ b/node_modules/honeycomb-grid/package.json
@@ -8,7 +8,10 @@
   "types": "dist/index.d.ts",
   "exports": {
     ".": {
-      "import": "./dist/honeycomb-grid.mjs",
+      "import": {
+        "default": "./dist/honeycomb-grid.mjs",
+        "types": "./dist/index.d.ts"
+      },
       "require": "./dist/honeycomb-grid.umd.js"
     }
   },

This issue body was partially generated by patch-package.

@flauwekeul
Copy link
Owner

Thanks. I'll look into it later.

@SIGSTACKFAULT
Copy link
Contributor

SIGSTACKFAULT commented Jul 8, 2023

just deleting the exports block also fixed it for me. I'm not sure why it worked before.

@SIGSTACKFAULT
Copy link
Contributor

SIGSTACKFAULT commented Jul 9, 2023

upgrading to TS5 fixed it for me, but I couldn't repro the problem at all in a blank project so /shrug the problem spontaneously came back five minutes later with no changes

@SIGSTACKFAULT
Copy link
Contributor

adding "resolvePackageJsonExports": false to my tsconfig fixed it for me

ts docs

@flauwekeul
Copy link
Owner

Sorry for the late fix 😬

github-actions bot pushed a commit that referenced this issue Jul 14, 2023
# [v4.1.2](v4.1.1...v4.1.2) (2023-07-14)

## 🐛 Bug Fixes
- [`af8725f`](af8725f)  properly export types (Issues: [`#103`](#103))

## [4.1.2](v4.1.1...v4.1.2) (2023-07-14)
@github-actions
Copy link

🎉 This issue has been resolved in version 4.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Altrue
Copy link

Altrue commented Jul 14, 2023

Unfortunately this is not fixed @flauwekeul, the package.json references a file located at "./dist/index.d.ts" but the file is actually located at "./src/dist/index.d.ts"

Sorry haha ;D

@flauwekeul
Copy link
Owner

Ugh 😒 I should've tested it. Trying to fix it now.

@flauwekeul flauwekeul reopened this Jul 14, 2023
github-actions bot pushed a commit that referenced this issue Jul 14, 2023
# [v4.1.3](v4.1.2...v4.1.3) (2023-07-14)

## 🐛 Bug Fixes
- [`509f966`](509f966)  Fix broken paths to types (Issues: [`#103`](#103))

## [4.1.3](v4.1.2...v4.1.3) (2023-07-14)
@github-actions
Copy link

🎉 This issue has been resolved in version 4.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SIGSTACKFAULT
Copy link
Contributor

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants