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

Circullar dependencies (Svelte + Rollup) #7133

Closed
@soyrubio

Description

@soyrubio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    4.x4.0 relatedBugAddressing a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions