typescript: error TS2693: 'Promise' only refers to a type, but is being used as a value here

前端 未结 22 2614
猫巷女王i
猫巷女王i 2020-11-29 19:35

I am trying to use Typescript for my AWS Lambda and i am getting the following errors where ever I use promises.

error TS2693: \'Promise\' only refers to a type,          


        
22条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 19:36

    I had the same error and I fixed it with this configuration:

    File: tsconfig.json

    {
      "compilerOptions": {
        "target": "es2015",                      
        "module": "commonjs",                    
        "strict": true,                          
        "esModuleInterop": true                  
      }
    }
    

提交回复
热议问题