Sometimes, we want to fix error TS2693: ‘Promise’ only refers to a type, but is being used as a value here with TypeScript.
In this article, we’ll look at how to fix error TS2693: ‘Promise’ only refers to a type, but is being used as a value here with TypeScript.
How to fix error TS2693: ‘Promise’ only refers to a type, but is being used as a value here with TypeScript?
To fix error TS2693: ‘Promise’ only refers to a type, but is being used as a value here with TypeScript, we install the @types/es-promise
package.
To install it, we run
npm i --save-dev @types/es6-promise
Then we use it by writing
import { Promise } from "es6-promise";
to import the Promise
type.