Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Circullar dependencies (Svelte + Rollup) #7133

Closed
soyrubio opened this issue Jul 1, 2024 · 4 comments
Closed

Circullar dependencies (Svelte + Rollup) #7133

soyrubio opened this issue Jul 1, 2024 · 4 comments
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@soyrubio
Copy link

soyrubio commented Jul 1, 2024

I am using web3-types and web3-eth-abi in my Svelte project (/w typescript).
When importing web3-eth-abi, I get the following error on bundling my project using rollup:

[1] (!) Circular dependencies
[1] node_modules/web3-eth-abi/lib/esm/coders/base/tuple.js -> node_modules/web3-eth-abi/lib/esm/coders/base/index.js -> node_modules/web3-eth-abi/lib/esm/coders/base/tuple.js
[1] node_modules/web3-eth-abi/lib/esm/coders/base/index.js -> node_modules/web3-eth-abi/lib/esm/coders/base/array.js -> node_modules/web3-eth-abi/lib/esm/coders/base/index.js

I tried installing both installing whole web3 package, and also just the web3-eth-abi module separatelly. Both are causing me this issue.

See full output below:

[1] node_modules/web3-utils/lib/esm/socket_provider.js
[1] 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
[1]                     ^
[1] 2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
[1] 3:     return new (P || (P = Promise))(function (resolve, reject) {
[1] ...and 1 other occurrence
[1] node_modules/web3-utils/lib/esm/web3_eip1193_provider.js
[1] 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
[1]                     ^
[1] 2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
[1] 3:     return new (P || (P = Promise))(function (resolve, reject) {
[1] ...and 1 other occurrence
[1] node_modules/web3-utils/lib/esm/promise_helpers.js
[1] 15: along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
[1] 16: */
[1] 17: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
[1]                      ^
[1] 18:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
[1] 19:     return new (P || (P = Promise))(function (resolve, reject) {
[1] ...and 1 other occurrence
[1] node_modules/web3-utils/lib/esm/web3_deferred_promise.js
[1] 15: along with web3.js.  If not, see <http://www.gnu.org/licenses/>.
[1] 16: */
[1] 17: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
[1]                      ^
[1] 18:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
[1] 19:     return new (P || (P = Promise))(function (resolve, reject) {
[1] ...and 1 other occurrence
[1] node_modules/web3-types/lib/esm/web3_base_provider.js
[1] 1: var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
[1]                     ^
[1] 2:     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
[1] 3:     return new (P || (P = Promise))(function (resolve, reject) {
[1] ...and 1 other occurrence
@SantiagoDevRel
Copy link

SantiagoDevRel commented Jul 1, 2024

Hi @soyrubio thanks for sharing this, the team will take a look at it asap💪
PS: which version of web3js are you using?

@soyrubio
Copy link
Author

soyrubio commented Jul 1, 2024

Thanks! 🙏

package.json

"web3-eth-abi": "^4.2.2",
"web3-types": "^1.6.0"

package-lock.json

"node_modules/web3-errors": {
  "version": "1.2.0",
  "resolved": "https://registry.npmjs.org/web3-errors/-/web3-errors-1.2.0.tgz",
  "integrity": "sha512-58Kczou5zyjcm9LuSs5Hrm6VrG8t9p2J8X0yGArZrhKNPZL66gMGkOUpPx+EopE944Sk4yE+Q25hKv4H5BH+kA==",
  "dependencies": {
    "web3-types": "^1.6.0"
  },
  "engines": {
    "node": ">=14",
    "npm": ">=6.12.0"
  }
},
"node_modules/web3-eth-abi": {
  "version": "4.2.2",
  "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-4.2.2.tgz",
  "integrity": "sha512-akbGi642UtKG3k3JuLbhl9KuG7LM/cXo/by2WfdwfOptGZrzRsWJNWje1d2xfw1n9kkVG9SAMvPJl1uSyR3dfw==",
  "dependencies": {
    "abitype": "0.7.1",
    "web3-errors": "^1.2.0",
    "web3-types": "^1.6.0",
    "web3-utils": "^4.3.0",
    "web3-validator": "^2.0.6"
  },
  "engines": {
    "node": ">=14",
    "npm": ">=6.12.0"
  }
},
"node_modules/web3-types": {
  "version": "1.6.0",
  "resolved": "https://registry.npmjs.org/web3-types/-/web3-types-1.6.0.tgz",
  "integrity": "sha512-qgOtADqlD5hw+KPKBUGaXAcdNLL0oh6qTeVgXwewCfbL/lG9R+/GrgMQB1gbTJ3cit8hMwtH8KX2Em6OwO0HRw==",
  "engines": {
    "node": ">=14",
    "npm": ">=6.12.0"
  }
},
"node_modules/web3-utils": {
  "version": "4.3.0",
  "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-4.3.0.tgz",
  "integrity": "sha512-fGG2IZr0XB1vEoWZiyJzoy28HpsIfZgz4mgPeQA9aj5rIx8z0o80qUPtIyrCYX/Bo2gYALlV5SWIJWxJNUQn9Q==",
  "dependencies": {
    "ethereum-cryptography": "^2.0.0",
    "eventemitter3": "^5.0.1",
    "web3-errors": "^1.2.0",
    "web3-types": "^1.6.0",
    "web3-validator": "^2.0.6"
  },
  "engines": {
    "node": ">=14",
    "npm": ">=6.12.0"
  }
},
"node_modules/web3-validator": {
  "version": "2.0.6",
  "resolved": "https://registry.npmjs.org/web3-validator/-/web3-validator-2.0.6.tgz",
  "integrity": "sha512-qn9id0/l1bWmvH4XfnG/JtGKKwut2Vokl6YXP5Kfg424npysmtRLe9DgiNBM9Op7QL/aSiaA0TVXibuIuWcizg==",
  "dependencies": {
    "ethereum-cryptography": "^2.0.0",
    "util": "^0.12.5",
    "web3-errors": "^1.2.0",
    "web3-types": "^1.6.0",
    "zod": "^3.21.4"
  },
  "engines": {
    "node": ">=14",
    "npm": ">=6.12.0"
  }
},

@mconnelly8 mconnelly8 added Bug Addressing a bug 4.x 4.0 related labels Jul 8, 2024
@mconnelly8
Copy link

Hey @soyrubio, can you provide a link to your project for us to review?

@luu-alex
Copy link
Contributor

Sorry we didn't respond to this, this should be fixed in the latest version checked by another comment here. #7250 (comment)
If anyone else is facing issues we can reopen this. Thank!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

4 participants