web3-storage / web3.storage

DEPRECATED ⁂ The simple file storage service for IPFS & Filecoin
https://web3.storage
Other
502 stars 121 forks source link

yarn add web3.storage, but module not found #2316

Open hauchu1998 opened 1 year ago

hauchu1998 commented 1 year ago

Hey

I'm trying to upload images to IPFS through web3.storage pkg on my NextJS app. I install it with yarn add web3.storage, and I'm pretty sure that it exist in the node_modules. But, when I import it, it still show Cannot find module 'web3.storage' or its corresponding type declarations.. Anyone know how to fix?

yarn: 1.22.19 node: 18.12.0 npm: 8.19.2 nextjs: v13

image

package.json

"dependencies": { "@privy-io/wagmi-connector": "^0.1.4", "@wagmi/chains": "^1.8.0", "@web3modal/ethereum": "^2.7.1", "@web3modal/react": "^2.7.1", "@xmtp/content-type-reaction": "^1.1.1", "@xmtp/content-type-read-receipt": "^1.1.2", "@xmtp/content-type-remote-attachment": "^1.1.1", "@xmtp/content-type-reply": "^1.1.2", "@xmtp/react-components": "1.0.0-preview.0", "@xmtp/react-sdk": "^1.3.7", "@xmtp/xmtp-js": "^11.0.0", "date-fns": "^2.30.0", "interweave": "^13.1.0", "interweave-autolink": "^5.1.0", "interweave-emoji": "^7.0.0", "minimist": "^1.2.5", "next": "latest", "react": "latest", "react-blockies": "^1.4.1", "react-dom": "latest", "react-icons": "^4.11.0", "react-media-recorder-2": "^1.6.23", "react-timer-hook": "^3.0.7", "react-virtuoso": "^4.6.0", "viem": "^1.14.0", "wagmi": "^1.4.2", "web3.storage": "4.5.5", "zustand": "^4.4.3" },

wslyvh commented 11 months ago

Try changing moduleResolution in your tsconfig to 'node'

"compilerOptions": {
    "moduleResolution": "node",
  },
shameelsadaka commented 11 months ago

Same issue here. Why it is happening ? Anyway to solve it without changing moduleResolution config ?