import { createWeb3Modal, defaultConfig, useWeb3ModalAccount } from '@web3modal/ethers/react'
在这一行中,我遇到了这个错误
ERROR in [eslint]
src\components\App\App.jsx
Line 1:69: Unable to resolve path to module '@web3modal/ethers/react' import/no-unresolved
即使我也在Package.json中安装了
"dependencies": {
"@sentry/cli": "^2.31.0",
"@sentry/react": "^7.108.0",
"@tanstack/react-query": "^5.28.2",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^15.0.4",
"@testing-library/user-event": "^14.5.2",
"@web3modal/ethers": "^4.1.11",
"eslint-plugin-prettier": "^5.1.3",
"eth-connect": "^6.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-google-recaptcha-v3": "^1.10.1",
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.3",
"react-scripts": "5.0.1",
"recoil": "^0.7.7",
"redux": "^5.0.1",
"web-vitals": "^2.1.4"
},
这样做
// eslint-disable-next-line import/no-unresolved
让错误消失,但这不是正确的方式,这是暂时的, 请任何人帮助永久解决这个问题,这样它就不会在eslint中出现错误.