klaytn / caver-js

Official caver-js repository
GNU Lesser General Public License v3.0
114 stars 75 forks source link

unhandled Runtime Error TypeError: https.Agent is not a constructor #596

Closed Kyungminkim31 closed 2 years ago

Kyungminkim31 commented 2 years ago

Hi!

I just made some test code to connect to a Klaytn node on test network, but I got an error message below.

Error Message:

Unhandled Runtime Error TypeError: https.Agent is not a constructor

image

As you could see the picture above, I just tried to initiate the caver variable then, it happened...

For reference, I left my dependencies from package.json below.

  "dependencies": {
    "caver-js": "^1.6.8",
    "next": "12.0.10",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "sass": "^1.49.7"
  },
  "devDependencies": {
    "@types/node": "17.0.18",
    "@types/react": "17.0.39",
    "@typescript-eslint/eslint-plugin": "^5.12.0",
    "@typescript-eslint/parser": "^5.12.0",
    "eslint": "^8.9.0",
    "eslint-config-airbnb": "^19.0.4",
    "eslint-config-next": "12.0.10",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-jsx-a11y": "^6.5.1",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0",
    "typescript": "4.5.5"
  }

Could you guys give me any suggestion or guide to resolve this issue ?

Thanks, KK

Kyungminkim31 commented 2 years ago

I just found the solution and applied it on my project.

The error doesn't show anymore...

please ignore what i've posted.

Thank you~