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

[bug] tsc compiling issue during wrong import path in modal-core #34

@mojtabast

Description

@mojtabast

Link to minimal reproducible example

https://github.com/mojtabast/wc-modal-import-issue

Summary

@walletconnect/modal build artifacts has a incorrect import from an absolute path which can not be resolved.

If you take a look at this path @walletconnect/modal/dist/_types/src/client.d.ts you will see an import import("packages/modal-core/dist/_types/src/controllers/ModalCtrl"). it should be @walletconnect/modal-core/dist/_types/src/controllers/ModalCtrl to problem goes away.

there are actually two error in this file. this is the actual error:

node_modules/@walletconnect/modal/dist/_types/src/client.d.ts:12:34 - error TS2307: Cannot find module 'packages/modal-core/dist/_types/src/controllers/ModalCtrl' or its corresponding type declarations.

12     openModal: (options?: import("packages/modal-core/dist/_types/src/controllers/ModalCtrl").OpenOptions | undefined) => Promise<void>;
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@walletconnect/modal/dist/_types/src/client.d.ts:14:50 - error TS2307: Cannot find module 'packages/modal-core/dist/_types/src/types/controllerTypes' or its corresponding type declarations.

14     subscribeModal: (callback: (newState: import("packages/modal-core/dist/_types/src/types/controllerTypes").ModalCtrlState) => void) => () => void;
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 2 errors in the same file, starting at: node_modules/@walletconnect/modal/dist/_types/src/client.d.ts:12

You can test with my repo. It seems other people is facing with same issue as well.

List of related npm package versions

"dependencies": {
"@walletconnect/modal": "2.6.2"
},
"devDependencies": {
"typescript": "5.5.4"
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions