Uniswap / smart-order-router

GNU General Public License v3.0
413 stars 419 forks source link

Runtime error #127

Open TJOSERAFAEL opened 2 years ago

TJOSERAFAEL commented 2 years ago
ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'WXDAI_GNOSIS')
TypeError: Cannot read properties of undefined (reading 'WXDAI_GNOSIS')
    at Module.WXDAI_GNOSIS (gas-price-provider.js:5:1)
    at 12037 (chains.js:228:23)
    at __webpack_require__ (bootstrap:19:1)
    at 84177 (UniswapInterfaceMulticall__factory.js:122:1)
    at __webpack_require__ (bootstrap:19:1)
    at 38863 (chains.js:346:1)
    at __webpack_require__ (bootstrap:19:1)
    at 77840 (caching-token-list-provider.js:6:39)
    at __webpack_require__ (bootstrap:19:1)
    at 59127 (gas-price-provider.js:5:1)
    at resolvePromise (zone.js:1255:1)
    at resolvePromise (zone.js:1209:1)
    at zone.js:1321:1
    at ZoneDelegate.invokeTask (zone.js:434:1)
    at Object.onInvokeTask (core.mjs:25463:33)
    at ZoneDelegate.invokeTask (zone.js:433:1)
    at Zone.runTask (zone.js:205:1)
    at drainMicroTaskQueue (zone.js:620:1)

This happens when I initialize AlphaRouter:

import { AlphaRouter } from '@uniswap/smart-order-router';
.
.
.

let chainId = 3

let web3Provider = new ethers.providers.JsonRpcProvider(MY_PROVIDER);
let router = new AlphaRouter({ chainId: chainId, provider: web3Provider})
"dependencies": {
    "@angular/animations": "~13.0.0",
    "@angular/cdk": "^13.2.2",
    "@angular/common": "~13.0.0",
    "@angular/core": "~13.0.0",
    "@angular/forms": "~13.0.0",
    "@angular/material": "^13.2.2",
    "@angular/platform-browser": "~13.0.0",
    "@angular/platform-browser-dynamic": "~13.0.0",
    "@angular/router": "~13.0.0",
    "@angular/service-worker": "^13.1.1",
    "@auth0/angular-jwt": "^5.0.2",
    "@ionic/angular": "^6.0.1",
    "@metamask/detect-provider": "^1.2.0",
    "@ngx-translate/core": "^14.0.0",
    "@ngx-translate/http-loader": "^7.0.0",
    "@techiediaries/ngx-qrcode": "^9.1.0",
    "@types/retry": "^0.12.2",
    "@uniswap/sdk": "^3.0.3",
    "@uniswap/sdk-core": "^3.0.1",
    "@uniswap/smart-order-router": "^2.5.30",
    "@uniswap/v3-sdk": "^3.8.2",
    "chart.js": "^3.7.1",
    "croppie": "^2.6.5",
    "ethers": "^5.6.8",
    "ionic-selectable": "^4.9.0",
    "jsbi": "^3.2.5",
    "moment-timezone": "^0.5.34",
    "ng-recaptcha": "^9.0.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "web3": "^1.7.3",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.0.1",
    "@angular-eslint/builder": "~13.0.1",
    "@angular-eslint/eslint-plugin": "~13.0.1",
    "@angular-eslint/eslint-plugin-template": "~13.0.1",
    "@angular-eslint/template-parser": "~13.0.1",
    "@angular/cli": "~13.0.1",
    "@angular/compiler": "~13.0.0",
    "@angular/compiler-cli": "~13.0.0",
    "@angular/language-service": "~13.0.0",
    "@ionic/angular-toolkit": "^5.0.0",
    "@ngx-env/builder": "^2.0.2",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "5.3.0",
    "@typescript-eslint/parser": "5.3.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^5.0.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~3.8.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "^6.3.20",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "typescript": "~4.4.4"
  },
  "description": "An multi-exchange of crypto project",
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": []
  }

And my nodejs version: 14.15.0

Thank you for your help

a-creation commented 2 years ago

Seconded.

willpote commented 2 years ago

Can you try 2.8.1 and let me know if it works?