Skip to content

Unable to execute verify function #46

Description

@aph5nt

I get the following error during compile time

node_modules/web3-token/dist/web3-token.d.ts:7:31 - error TS2307: Cannot find module './lib/interfaces' or its corresponding type declarations.

7         sign: (signer: import("./lib/interfaces").Signer, opts?: string | import("./lib/interfaces").SignOpts) => Promise<string>;
                                ~~~~~~~~~~~~~~~~~~

node_modules/web3-token/dist/web3-token.d.ts:7:82 - error TS2307: Cannot find module './lib/interfaces' or its corresponding type declarations.

7         sign: (signer: import("./lib/interfaces").Signer, opts?: string | import("./lib/interfaces").SignOpts) => Promise<string>;
                                                                                   ~~~~~~~~~~~~~~~~~~

node_modules/web3-token/dist/web3-token.d.ts:8:47 - error TS2307: Cannot find module './lib/interfaces' or its corresponding type declarations.

8         verify: (token: string, opts?: import("./lib/interfaces").VerifyOpts) => {
                                                ~~~~~~~~~~~~~~~~~~

node_modules/web3-token/dist/web3-token.d.ts:10:26 - error TS2307: Cannot find module './lib/interfaces' or its corresponding type declarations.

10             body: import("./lib/interfaces").DecryptedBody;
                            ~~~~~~~~~~~~~~~~~~


Found 4 errors in the same file, starting at: node_modules/web3-token/dist/web3-token.d.ts:7

source code:


export async function authorize(token) {
    try {

        const { address, body } = await verify(token);

        return {};
    } catch (e) {
        // eslint-disable-next-line no-console
        return null;
    }
}

package.json

  "name": "",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "prestart": "npm run build",
    "start": "func start",
    "test": "echo \"No tests yet...\""
  },
  "dependencies": {
    "@moralisweb3/streams-typings": "^1.0.5",
    "ethers": "^5.7.1",
    "i": "^0.3.7",
    "npm": "^8.19.2",
    "web3-token": "^1.0.2"
  },
  "devDependencies": {
    "@azure/functions": "^3.0.0",
    "typescript": "^4.0.0"
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions