-
Notifications
You must be signed in to change notification settings - Fork 17
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
'decode' is not exported from '@ipld/dag-cbor' #37
Comments
What environment are you trying to build and run this in @luizoamorim? This wouldn't be Jest would it? You're possibly using an environment that doesn't support export maps properly but there should be workarounds. |
I got the same error using nft.storage with next.js and it fails during build time. Did anyone found the workaround yet? |
Can you provide some code to reproduce this? We have a lot of folks (including myself for percid.va.gg) using this code directly via next.js and other frameworks and nft.storage and web3.storage without these problems, so there must be something specific about the environment that's causing a hiccup. Can you describe the toolchain and setup in a way that might help us narrow it down? |
I'm stuck with this issue. TLDR of nftstorage/nft.storage#215 (comment): I have to downgrade
My package.json:
|
If someone experiencing this can provide a very simple reproduction they can share, maybe just a basic project that doesn't build, shared as a repo or some other way, that would be extremely helpful in narrowing this down. Having to support so many permutations of build environment makes this a bit tricky to isolate without help. |
@rvagg there's an example in this comment from the related issue. It does fail to build, but if I delete the Perhaps relevant: I also tried copying all the dependencies and devDependencies from the failing project to the "noerrror" project, but I wasn't able to reproduce the error that way either. All this was tested on an M1 MacBook Air - the node 16 build is ARM-native, but v14 is emulated through Rosetta. Anyway, no conclusions, but maybe that will help rule some things out. @fungilation if you could put up a repo that demonstrates the issue that would help. Your OS and node.js version may be relevant also. |
@rvagg @yusefnapora I found this issue trying to code with the demo of Next.js Here's my steps to reproduce:
And get this result:
I get this error using both Thanks for looking into this! |
When I tried
|
Still running into this with |
@achingbrain suspected this might be related to webpack/webpack#14268 which was about a very similar problem in our stack. webpack/enhanced-resolve#304 is related and lead to webpack/enhanced-resolve#305 in enhanced-resolve. I've used @LAMike310's suggestion for how to replicate the problem (with js-ipfs-browser-nextjs - can confirm, it breaks, thanks @LAMike310!), and have applied the fix for enhanced-resolve's So it's to do with our heavy reliance on export maps and the So enhanced-resolve has a fix. But unfortunately that needs to bubble from there to webpack and to nextjs. And as mentioned in webpack/enhanced-resolve#304 (comment), it's not going to be backported. |
Easy FIX: I just updated |
closing because this seems to have been fixed by toolchain updates |
I'm using nft.storage in my project. This library have ipld dependence.
I've got this error when I try generate a project build:
./node_modules/@ipld/car/esm/lib/decoder.js
Attempted import error: 'decode' is not exported from '@ipld/dag-cbor' (imported as 'decodeDagCbor').
Can somebody help me?
The text was updated successfully, but these errors were encountered: