- Notifications
You must be signed in to change notification settings - Fork202
fix: invalid path for export in package.json (v 5.0.0)#164
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
cristianoliveira commentedFeb 10, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
For those who use webpack and want a quick fix, while this isn't correctly addressed, you can create an alias and point to the correct file: In the webpack.config.js include: resolve:{alias:{'unfetch':path.resolve(__dirname,'node_modules/unfetch/dist/unfetch.mjs'),},}, |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Ryan Christian <33403762+rschristian@users.noreply.github.com>
rschristian commentedFeb 15, 2023
Looks correct to me! |
ayZagen commentedMar 27, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@rschristian@developit pinging in case you have forgotten to approve |
rschristian commentedMar 28, 2023
Sorry, not a maintainer, my approval does nothing. Just a drive-by suggestion as I ran into this and was seeing if anyone had submitted a fix yet. |
denizsult commentedJun 1, 2023
Workes fine. Thanks |
This is pending a fix to a how unfetch 5 exports its files, e.g.developit/unfetch#164
This is pending a fix to a how unfetch 5 exports its files, e.g.developit/unfetch#164
Skopea commentedSep 9, 2023
Can this be merged? I really need this change since in cannot start storybook in my project, Thanks for fixing this! 🥳 |
alinasir85 commentedOct 23, 2023
@rschristian , Kindly approve & merge it |
rschristian commentedOct 23, 2023
|
alinasir85 commentedOct 23, 2023
But its showing that your review is pending.. ![]() |
rschristian commentedOct 23, 2023
Doesn't matter -- GitHub's UI is a bit weird there for sure, but the approval of non-maintainers does nothing. You'd see a "collaborator" badge (I think) next to my name if I was able to approve and merge. |
alinasir85 commentedOct 23, 2023
katerberg commentedOct 24, 2023
This would be really nice to have merged since it currently is unusable in For anyone else using
|
tdacu commentedNov 16, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
=> Failed to build the preview And if I'm importing
I'm still getting |
Without this patch people were experiencing problems when bundling theSDK. See issueToucanProtocol#95ToucanProtocol#95The problem is that `isomorphic-unfetch` 4.0.2 upgraded to `unfetch`5.0.0 which currently has an issue with their module exports leading toan error when bundling the lib itself or any other lib that depends on`unfetch`.See this PR for more information:developit/unfetch#164Once this PR is merged we can go back to the latest `isomorphic-unfetch`version.
Without this patch people were experiencing problems when bundling theSDK. See issueToucanProtocol#95ToucanProtocol#95The problem is that `isomorphic-unfetch` 4.0.2 upgraded to `unfetch`5.0.0 which currently has an issue with their module exports leading toan error when bundling the lib itself or any other lib that depends on`unfetch`.See this PR for more information:developit/unfetch#164Once the PR above is merged we can go back to the latest `isomorphic-unfetch`version.
tim-kilian commentedMar 28, 2024
Can someone merge this, please? |
An issue with `unfetch@5`, depended on by `isomorphic-unfetch@4.0.2`,breaks bundling with tools such as `esbuild` and `webpack`:developit/unfetch#164
alopix commentedAug 27, 2024
Any chance this can get merged and published? Lots of bundler workarounds required right now 😅 |
katerberg commentedApr 30, 2025
@developit is this possible to merge? Not sure on the status on the library, but this one would be a really helpful fix. |
First of all, thanks for this library! We have been using it for quite a long time, and it works like a charm.
Description
It seems that there are invalid values exported in the package.jsonhttps://github.com/developit/unfetch/blob/main/package.json#L18
It causes issue while using
unfetch
as a module, for instance, we use webpack and once upgraded to 5.0.0 it started to break the build with the given (not so clear, to say the least) error:Demo
Here you can see an example of this issue:
https://github.com/cristianoliveira/unfetch-issue-demo
Solution
After pointing to
src/index.mjs
it started to compile again and it is working as expected. 😄Let me know if this is the right solution.
Relates to
#163
#162