Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Types that are found, but not exported in package.json #33

Open
adxmcollins opened this issue Jan 9, 2024 · 2 comments
Open

Types that are found, but not exported in package.json #33

adxmcollins opened this issue Jan 9, 2024 · 2 comments

Comments

@adxmcollins
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Because of some changes with TypeScript (moduleResolution = bundler), the types are not working with newer versions of TypeScript. The following change needs to be made to make sure the types are exported in a way which works with bundler.

More details can be found here: microsoft/TypeScript#52363

It's only a small change to fix it. Here is the diff that solved the problem:

diff --git a/node_modules/lemonsqueezy.ts/package.json b/node_modules/lemonsqueezy.ts/package.json
index e5a0751..bc84638 100644
--- a/node_modules/lemonsqueezy.ts/package.json
+++ b/node_modules/lemonsqueezy.ts/package.json
@@ -32,7 +32,10 @@
   },
   "exports": {
     ".": {
-      "import": "./dist/index.mjs",
+      "import": {
+        "types": "./dist/index.d.ts",
+        "default": "./dist/index.mjs"
+      },
       "require": "./dist/index.js"
     },
     "./checkout": {

This issue body was partially generated by patch-package.

@hellofaizan
Copy link

@NuroDev merge this Pull Request

@hellofaizan
Copy link

@JulianBerger Itworked, can you tell me one thing, i hosted website on vercel, but i cant make changes in node_module in vercel, need help with that, build failed on vercel due to this issue

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

No branches or pull requests

2 participants