netgum / archanova

Archanova monorepo
https://archanova.io/
19 stars 11 forks source link

Could not find a declaration file for module 'ethjs' #39

Closed pedrouid closed 4 years ago

pedrouid commented 5 years ago

Failed to compile because I got the following error message: Could not find a declaration file for module 'ethjs'

I tried to install @types/ethjs but wasn't successful

I managed to work around it by adding an empty declaration to the root directory index.d.ts declare module "ethjs";

But then I ended getting a different error that I couldn't fix: Cannot use namespace 'IProvider' as a type.

pedrouid commented 5 years ago

The Typescript environment is generated using: create-react-app APP_NAME --scripts-version=react-scripts-ts

Used the following tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "build/dist",
    "module": "esnext",
    "target": "es5",
    "lib": ["esnext", "es7", "dom"],
    "sourceMap": true,
    "allowJs": true,
    "jsx": "react",
    "moduleResolution": "node",
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "allowSyntheticDefaultImports": true,
    "noUnusedLocals": true,
    "resolveJsonModule": true
  },
  "exclude": [
    "node_modules",
    "build",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest",
    "src/setupTests.ts"
  ]
}
stanislaw-glogowski commented 4 years ago

Please try to use our missing typescript definition npm: https://github.com/netgum/netgum-types