There is uniswap error I can't able to reasole it - node-modules

I am using Uniswap SDK for swapping the tokens I was working fine but now it is throwing an error, but I don't know why. I also install npm #uniswap/v3-periphery but it can't work for me.
Here is the error:
./node_modules/#uniswap/v3-sdk/dist/v3-sdk.esm.js:7:0
Module not found: Can't resolve '#uniswap/v3-periphery/artifacts/contracts/interfaces/IMulticall.sol/IMulticall.json'
Import trace for requested module:
./node_modules/#uniswap/smart-order-router/build/module/providers/on-chain-quote-provider.js
./node_modules/#uniswap/smart-order-router/build/module/providers/index.js
./node_modules/#uniswap/smart-order-router/build/module/index.js
./components/app/Swapping.jsx
./pages/swap/index.tsx
https://nextjs.org/docs/messages/module-not-found
And here is the package.json file:
{
"name": "helpi-finance",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#headlessui/react": "^1.7.0",
"#rainbow-me/rainbowkit": "^0.5.1",
"#uniswap/sdk": "^3.0.3",
"#uniswap/sdk-core": "^3.0.1",
"#uniswap/smart-order-router": "^2.5.30",
"#uniswap/v3-sdk": "^3.8.2",
"ethers": "^5.0.0",
"jsbi": "3.2.5",
"next": "^12.1.6",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-icons": "^4.4.0",
"react-spinners": "^0.13.4",
"react-toastify": "^9.0.8",
"wagmi": "^0.6.0"
},
"devDependencies": {
"#types/node": "^17.0.35",
"#types/react": "^18.0.9",
"autoprefixer": "^10.4.8",
"eslint": "^8.15.0",
"eslint-config-next": "^12.1.6",
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8",
"typescript": "^4.7.2"
}
}

After Stuck 3 to 4 Days If find out, By installing a specific version of #uniswap/v3-periphery#1.4.1 resolves this issue.
npm i #uniswap/v3-periphery#1.4.1

/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/logger/src.ts/index.ts:269
const error: any = new Error(message);
^
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.1)
at Logger.makeError (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/logger/src.ts/index.ts:281:20)
at JsonRpcProvider.<anonymous> (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/providers/src.ts/json-rpc-provider.ts:483:23)
at step (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/Users/xxx/Desktop/Ethjs/uniswapV3_SDK/node_modules/#ethersproject/providers/lib/json-rpc-provider.js:21:65)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}
After I run follow your instruction, I got this problem instead? Do you counter the same problem?

Related

NPM RUN WATCH doesn't finish it's job

Hi everyone I'm new in laravel, I'm using laravel 9, i tried to run (npm run watch) and it's about 30 mins nothing happened,
this's the message i get.
Hopefully I get some answers,
thank you in advance
i have tried npm run dev it doesn't work , so i replace it with npm run build .
this is what my package.json look like:
"private": true,
"scripts": {
"dev": "vite",
"watch": "npm-watch",
"build": "vite build"
},
"devDependencies": {
"#tailwindcss/forms": "^0.5.2",
"alpinejs": "^3.4.2",
"autoprefixer": "^10.4.2",
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.3",
"lodash": "^4.17.19",
"postcss": "^8.4.6",
"tailwindcss": "^3.1.0",
"vite": "^4.0.3"
},
"dependencies": {
"npm-watch": "^0.11.0"
},
"watch": {
"build": {
"patterns": [
"src"
],
"extensions": "js,jsx"
}
}
}
I added ( "watch": "npm-watch",)

Module parse failed: Unexpected token in a react with redux toolkit node module

I'm trying to work out how to create a react + redux node module for my react + redux toolkit sites. I've got multiple sites with common components and I'd like to share them using a module.
I have managed to create, publish (using npm publish), and install my node module on to my site, but whenever I try and run with it installed I get the below error for any component I make in the module.
This is the package.json on my node module. I've made sure that any dependencies match the version I use on my sites.
`
{
"name": "cpl-react-test",
"version": "3.0.4",
"peerDependencies": {
"#reduxjs/toolkit": "^1.8.5",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.1.1",
"#testing-library/user-event": "^13.5.0",
"#types/jest": "27.4.1",
"#types/node": "16.11.27",
"#types/react": "18.0.6",
"#types/react-dom": "18.0.2",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-redux": "8.0.2",
"react-scripts": "5.0.1",
"typescript": "^4.6.3",
"web-vitals": "^3.0.1"
},
"devDependencies": {
"#reduxjs/toolkit": "^1.8.5",
"#testing-library/jest-dom": "^5.16.4",
"#testing-library/react": "^13.1.1",
"#testing-library/user-event": "^13.5.0",
"#types/jest": "27.4.1",
"#types/node": "16.11.27",
"#types/react": "18.0.6",
"#types/react-dom": "18.0.2",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-redux": "8.0.2",
"react-scripts": "5.0.1",
"typescript": "^4.6.3",
"web-vitals": "^3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) TS template.",
"main": "index.tsx",
"author": "",
"license": "ISC"
}
`
I have researched this a bit, but I'm struggling to find the solution, I think because I don't really understand the problem, or whether I'm going about this the right way at all. Any insight on what I should be looking for or doing would be greatly appreciated.

Webpack not found when deploying using heroku

I'm trying to deploy an app on heroku, but I'm getting an error when it tried to build the app with the webpack command. I have tried a number of fixes but can't seem to get it to work. I tried running the webpack.js file from node_modules like this node node_modules/webpack/bin/webpack.js but that didn't work either. Any ideas would be greatly appreciated! Here is my package.json file:
{
"name": "waste-not-client",
"version": "1.0.0",
"description": "",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "concurrently npm:watch:*",
"build": "webpack --mode production",
"watch:compile": "webpack --mode development --watch",
"watch:serve": "nodemon server/server.js",
"heroku-postbuild": "npm install && npm run build && node server/server.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Blue-ocean-HR/blueocean-client.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Blue-ocean-HR/blueocean-client/issues"
},
"homepage": "/",
"dependencies": {
"#auth0/auth0-react": "^1.12.0",
"axios": "^1.1.3",
"compression": "^1.7.4",
"concurrently": "^7.6.0",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"framer-motion": "^7.6.7",
"nodemon": "^2.0.20",
"path": "^0.12.7",
"react": "^18.2.0",
"react-autocomplete-input": "^1.0.19",
"react-dom": "^18.2.0",
"react-router-dom": "^6.4.3",
"webpack-bundle-analyzer": "^4.7.0"
},
"devDependencies": {
"#babel/core": "^7.12.3",
"#babel/plugin-syntax-jsx": "^7.18.6",
"#babel/preset-env": "^7.12.1",
"#babel/preset-react": "^7.12.5",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.1.2",
"babel-loader": "^8.2.1",
"compression-webpack-plugin": "^10.0.0",
"css-loader": "^6.7.1",
"dotenv-webpack": "^8.0.1",
"postcss": "^8.4.19",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.8.3",
"style-loader": "^3.3.1",
"tailwindcss": "^3.2.4",
"webpack": "^5.75.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1"
},
"engines": {
"node": "v16.16.0"
}
}
The error when I try to deploy on heroku:
sh: 1: webpack: not found
Your start script looks like it's designed for development work with live reloading. That's not what you want on Heroku.
You could rewrite your package.json scripts, but the easiest solution is probably to add a Procfile that Heroku will use in preference to your start script, e.g.
web: node server/server.js
You'll also want to remove your heroku-postbuild script entirely. It just repeats two things that Heroku does automatically (installing dependencies and running your build), and it also includes the runtime command that we now have in our Procfile.

VS 2022 w/Resharper not recognizing syntax in React Scripts

I'm installing some demo React JS applications. Some of them don't show syntax errors while others do. Am I missing a package in my solution? Or is there a setting in my VS Project that needs set/changed?
Here's a screenshot. The project's package.json is below. The code builds and runs fine with the exception of deprecation warnings, etc. (not important at this point).
{
"name": "conversations-demo-sdk-update",
"version": "1.2.0",
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"#twilio/conversations": "1.2.0",
"antd": "^3.26.20",
"dotenv": "^10.0.0",
"ngrok": "^3.4.0",
"node-sass": "^6.0.1",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-dropzone": "^10.2.2",
"react-router-dom": "^4.3.1",
"react-scripts": "4.0.1",
"request-promise": "^4.2.6",
"twilio": "~3.6.6"
},
"devDependencies": {
"concurrently": "^3.6.1",
"react-app-rewired": "^2.2.1"
},
"scripts": {
"start": "concurrently \"react-scripts start\" \"node index.js\"",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"keywords": [],
"description": ""
}
The problem ended up being JSX code in JS files. The fix is to enable Resharper's option to allow JSX in JS files.
Solution found here

undefined is not a function (near '...reactDevTools.connectToDevTools...')

I have spent over a day trying to get map view to work and along the way I picked up this error that I can't find anywhere at all on the internet. The error code shows up on iOS simulator with a red screen as is typical for react native.
I tried reinstalling the Dev Tools and that didn't work.
Here is my package.json
{
"name":"P77",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "^16.7.0",
"react-native": "0.57.8",
"react-native-elements": "^0.19.1",
"react-native-maps": "^0.22.1",
"react-native-vector-icons": "^6.1.0",
"react-navigation": "git+https://github.com/react-community/react-navigation.git"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-devtools": "^3.4.3",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
please help
I found out an answer that works for me, but I'm not sure. Maybe this can help people in the future. I ran:
"yarn add eslint-config-rallycoding --dev"
"npm start"
(in project directory)

Resources