-
Notifications
You must be signed in to change notification settings - Fork 41
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
Typescript/export/module/package.json B.S. #57
Comments
I ran into this problem today as well. The Diff that solves the problem: diff --git a/node_modules/aws4fetch/package.json b/node_modules/aws4fetch/package.json
index 4ea1e45..95842c7 100644
--- a/node_modules/aws4fetch/package.json
+++ b/node_modules/aws4fetch/package.json
@@ -14,7 +14,8 @@
"worker": "./dist/aws4fetch.esm.js",
"browser": "./dist/aws4fetch.umd.js",
"require": "./dist/aws4fetch.cjs.js",
- "default": "./dist/aws4fetch.umd.js"
+ "default": "./dist/aws4fetch.umd.js",
+ "types": "./dist/main.d.ts"
}
},
"types": "dist/main.d.ts", This was partially generated by patch-package. |
I don't think so, I think every export needs one, it also says the types should come first, and I should not have deleted the top level one as that's a fallback |
I'm confused about why this is a problem suddenly – the |
In our project, the issue occurred after converting to ES Modules. As I understand, it is not a TypeScript bug. Depending on configuration in
The solution for compatibility with projects like our own is to either add the explicit |
I think why now is Typescript 5 changed how it resolved. I think the motivation is that packages can distribute wildly different APIs per export, and thus need different types per export. Not sure why the top level type is not default though. I think @GusBuonv 's patch better captures there are not different type exports for this package |
I ran into this issue after switching from |
Also |
You can't apply a patch via EDIT: Oh, you can: |
I've just stumbled upon this issue as well after changing @mhart https://arethetypeswrong.github.io/?p=aws4fetch%401.0.17 |
Sorry for the notifications and off-topic but was just wondering if this is abandoned and I should fork or look for some other fork/alternative. Last commit in master was ~2 years ago and this is an actual/obvious issue that already has a PR with a fix for quite some time. |
This should be fixed in https://arethetypeswrong.github.io/?p=aws4fetch%401.0.18-beta.2 Will publish as ``v1.0.18` if it doesn't break anyone's workflows |
@mhart it works perfectly, thanks! |
Ok, feel like it's been enough time, lol. Have just published |
The text was updated successfully, but these errors were encountered: