booster icon indicating copy to clipboard operation
booster copied to clipboard

Can't compile a clean project: jsonwebtoken package types are missing

Open adrian-lorenzo opened this issue 2 years ago • 0 comments

Bug Report

Current Behavior

If you try to compile a clean project by using npm run compile, the following error appears:

node_modules/@boostercloud/framework-core/dist/services/token-verifiers/utilities.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'jsonwebtoken'. 'node_modules/jsonwebtoken/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/jsonwebtoken` if it exists or add a new declaration (.d.ts) file containing `declare module 'jsonwebtoken';`

2 import * as jwt from 'jsonwebtoken';
                       ~~~~~~~~~~~~~~

Expected behavior

To compile the application successfully.

Possible Solution

Installing the types in the project seems to solve the problem. We may be missing to add the package when building the project.

npm i --save-dev @types/jsonwebtoken

Additional information

Environment

  • Booster version: 0.30.6
  • Node/npm version: Node 16
  • OS: macOS 12.5.1

adrian-lorenzo avatar Aug 24 '22 10:08 adrian-lorenzo