daochild/tronweb-typescript

Cannot find module '@types/tronweb' or its corresponding type declarations.

Opened this issue · 9 comments

altbit commented

The project looks broken.

According to the package.json

...
   "license": "MIT",
  "main": "index.js",
  "name": "@daochild/tronweb-typescript",
...

there are no types defined and main file is index.js which doesn't exist in the package:
image

Look at the @types/uuid as a simple example how it should be done:

...
   "license": "MIT",
  "main": "",
  "name": "@types/uuid",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
    "directory": "types/uuid"
  },
  "scripts": {},
  "typeScriptVersion": "3.8",
  "types": "index.d.ts",
...

It was tested on node.js 16 and using with Goland IDE, types have been displayed.

Same issue too, how can i fix it @daochild ?

Same issue too, how can i fix it @daochild ?

Attempt check the next code example, maybe it will be helpful
https://github.com/daochild/tronweb-typescript/blob/main/src/tests/test.ts#L9

And let me know if it not.

I tried but not working

@uuhnaut69 @altbit Hi it should have been fixed for now. Could you check please?

Not working, can not reference to tronweb type

Hello, I had the same issue. Fixed it by adding @daochild/tronweb-typescript to the types section in tsconfig.json as following:

"types": [
      "@daochild/tronweb-typescript"
],

My package.json:

{
  "devDependencies": {
    "@daochild/tronweb-typescript": "^1.1.2",
    "typescript": "^5.3.3"
  },
  "dependencies": {
    "tronweb": "^5.3.1"
  }
}

Also, now there is no need for tripple-slash reference. I think there is a better way, but I couldn't find one.

same issue but it doesn't work for me.
installed @daochild/tronweb-typescript and added it to type section in tsconfig.json.
double checked package.json file too.

please let me know what i should do.

the solution is to add to tsconfig.json

  "include": [
    "src",
    "./node_modules/@daochild/tronweb-typescript/dist/index.d.ts"
  ],