-
Notifications
You must be signed in to change notification settings - Fork 37
v9.0.5
is causing other libraries to fail due to a TypeError
#172
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
Comments
How can I replicate this? I've tried running https://github.com/max-andrew/web3-storage-test but I get an error when I open the page: |
I'm not the author of the reproduction repo, but this error seems to be caused by Anyway you can comment that section (lines 12-14), as the error (if it appears) is caused by line 10, where the web3Storage client is initialised |
If I comment those lines out, I don't see any errors at all. $ npm ls ipfs-unixfs-importer
[email protected] /Users/alex/Documents/Workspaces/max-andrew/web3-storage-test
└─┬ [email protected]
└─┬ [email protected]
└── [email protected] |
I suspected that from your previous reply. Could it be caused by some specific configuration, or a global dependency that you have installed? I'm not sure what details I should give you to reproduce the issue If it can be of help I'm attaching the full error I get whenever I install v9.0.5.
|
I've got no specific config, I just cloned the repo and ran the commands. No global deps to speak of: $ ls -l /Users/alex/.nvm/versions/node/v16.8.0/lib/node_modules/
total 0
drwxr-xr-x 9 alex staff 288 31 Aug 12:03 david
drwxr-xr-x 9 alex staff 288 6 Sep 18:52 iim
drwxr-xr-x 12 alex staff 384 25 Aug 22:39 npm |
The only thing that comes to mind is I'm running on Node v14.16.1 (Anyway I opened the issue as I was not the first one to stumble upon it, and I thought you guys should be aware. Feel free to close it if you don't deem it relevant, I'll make sure to let you know in case I discover anything else) |
I just tried with The weird thing is there's no difference in the published cjs version of
It may have something to due with Next.js? It lets you use The "exports": {
".": {
"browser": "./esm/src/index.js",
"require": "./cjs/src/index.js",
"import": "./esm/src/index.js"
}
} Could you maybe try swapping the Failing that, it might be using the "browser": {
".": "./cjs/src/index.js"
}, Could try changing that to the esm version? |
Aha, I can replicate if I use yarn to install the deps, it doesn't happen if I use npm. |
Yup, that seems fishy. I definitely might be wrong, but it seems So looking at files changes in With respect to the changes you suggested, swapping I also tried enabling the experimental esm external flag in nextjs, but nothing changed. |
Installing the deps of the repro project with yarn results in lots of weird behaviour - source maps are broken, esm->cjs transiplation is broken, and even doing a production build of the app is broken. Install them with npm and everything works as expected - source maps, production builds, esm, everything. Comparing the dep tree between the two shows some small differences but nothing obvious (to me, though I don't use next.js) so I'm not sure what the problem is, but it's almost certainly between next.js/babel/webpack, and not something to do with this module, though I will happily merge any PR that fixes the issue if that's the case. I would open an issue against next.js with the repro repo, and in the meantime use npm instead. |
I should have specified that I also use npm, but still face the issue. I'm also unsure of the nature of the problem here, the only thing I can say for certain is that v9.0.4 works fine on my end. Will follow up on the issue in case I discover anything relevant, in the meantime thanks for looking into it! |
v9.0.6 (#173) seems to have fixed this. Thanks @achingbrain! |
The root issue appears to have been a bug in webpack, but as you've found it's fixed now: webpack/enhanced-resolve#304 |
An error seems to have been introduced in
v9.0.5
and has caused the following issues inweb3-storage
andjs-ipfs
which depend this library.web3-storage/web3.storage#471
ipfs/js-ipfs#3838
The error is the following:
TypeError: mergeOptions__default.default.bind is not a function
Manually installing
v9.0.4
seems to fix the issueThe text was updated successfully, but these errors were encountered: