-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ipfs-http-client is not compatible with vite #4091
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Could you give a bit more context please, how does A small GitHub repo that demonstrates the problem you are seeing would be very helpful. |
Hey, Let me know if any other logs would be helpful ! Component import { create } from "ipfs-http-client";
const NewAsset = () => {
// connect using a URL
const client = create("http://127.0.0.1:5002");
} TypeError Uncaught TypeError: require_get3(...) is not a function
at module2.exports (index.js:7:8)
at create2 (index.js:31:10)
at NewAsset (NewAsset.jsx:19:18)
at renderWithHooks (react-dom.development.js:14985:18)
at mountIndeterminateComponent (react-dom.development.js:17811:13)
at beginWork (react-dom.development.js:19049:16)
at HTMLUnknownElement.callCallback2 (react-dom.development.js:3945:14)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:16)
at invokeGuardedCallback (react-dom.development.js:4056:31)
at beginWork$1 (react-dom.development.js:23964:7) package.json {
"name": "krypt",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@honkhonk/vite-plugin-svgr": "^1.1.0",
"@metamask/detect-provider": "^1.2.0",
"@nomiclabs/hardhat-ethers": "^2.0.6",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@openzeppelin/contracts": "^4.6.0",
"@reduxjs/toolkit": "^1.7.1",
"axios": "^0.25.0",
"chai": "^4.3.6",
"dotenv": "^14.3.2",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.6.8",
"formik": "^2.2.9",
"hardhat": "^2.9.7",
"ipfs-http-client": "^50.1.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-redux": "^7.2.6",
"react-reveal": "^1.2.2",
"react-router-dom": "^6.2.1",
"redux": "^4.1.2",
"yup": "^0.32.11"
},
"devDependencies": {
"@vitejs/plugin-react": "^1.0.7",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.15",
"vite": "^2.7.2",
"web3modal": "^1.9.7"
}
} vite.config.js import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "@honkhonk/vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(), react()],
}); |
hey |
What could I do to get it working on my end? I tried disabling the error inside vite but it now just crashed whenever I try and use it. |
I'm so sorry. There is currently no way to fix such bugs. The only way to continue to use is to run after compilation, but the compilation results are not satisfactory and may lead to compilation errors |
This appears to be a bug in how vite handles transitive deps with exports maps. I've opened an issue on the vite repo with a minimal repro case here. |
The exports map issue is fixed in the latest vite beta. Unfortunately there are new regressions in that version. |
Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days. |
This issue was closed because it is missing author input. |
ipfs-http-client is not compatible with vite
Vite is a front-end development and construction tool
It's so fast
but ipfs-http-client requires esbuild
so ipfs-http-client is not compatible with vite
I hop you can finish the compatible with vite
The text was updated successfully, but these errors were encountered: