ts2339: property 'should' does not exist on type Bluebird<boolean>

ts2339 tsconfig
ts2339 react
error ts2339 angular 8
ts2339 ignore
disable ts2339
error ts2339 angular 9
ts2339 property fullname does not exist on type createemployeecomponent
error ts2339: property 'success' does not exist on type 'object'.

I wrote my mocha test in Typescript, and now I'm compiling it in es6

tsc *.ts --target es6 -m commonjs --watch

I get NO error in the console, But in the WebStorm I get underlined every 'should' chai-keyword with red (when I hover it I get a message: ts2339: property 'should' does not exist on type Bluebird).

for example I'm using 'chai' and I want to check is expected value true:

import * as chai    from "chai";

export class WrapedChai {
     public shouldBeTrue(valueToTest : any){
        let expectedValue : boolean = true;
        expectedValue.should.equal(valueToTest);
    }
// or usintg SHOULD with a Promise
     public belongsToGLOErrorPromise(valueToTest: any) {
        let expectedValue   : boolean = true;
        return Promise.resolve(expectedValue).should.eventually.equal(valueToTest);
    } 
}

and should is always underlined in red.

I tried this:

import { should } from 'chai';
should();

and this:

import chai = require('chai');
var should = chai.should();

but 'should' stil stays underlined as an error.

This can be solved with npm install @types/chai.

Getting error TS2339: Property does not exist on type for a valid ES6 , When compiled/transpiled through TypeScript it generates error TS2339: Property 'myclassvar' does not exist on type 'MyClass'. If the above� An advice on how to fix these errors error TS2339: Property '_input' does not exist on type 'FileUpload'. error TS2339: Property '_input' does - 1495015

OK, I solved the problem.

FIRST WAY TO SOLVE IT (use a hack): The Problem was with the types in TypeScript. Instead of writing

return Promise.resolve(isInstance).should.eventually.equal(expectedValue);

I split the line in two parts and wrote like this:

let helpVariable : any = Promise.resolve(isInstance);
return helpVariable.should.eventually.equal(expectedValue);

this way I'm applaying SHOULD on variable that has type any.

From some reason 'should' is underlined as an error if it is applied on any other type (like: boolean, int, number, string...)

SECOND WAY TO SOLVE IT (use 'export' keyword instead of 'should'): first import the keyword 'export' like this:

  import {expect} from 'chai';

then, instead of writing:

return Promise.resolve(isInstance).should.eventually.equal(expectedValue);

write:

return export(Promise.resolve(isInstance)).eventually.equal(expectedValue);

How to Solve “error TS2339: Property '<label>' does not exist on , error TS2339: Property 'firstName' does not exist on type '{}'. but I called printFistName() function like below let a={firstName:'Jhone',age:26}; Sibin on Can’t bind to ‘rangePicker’ since it isn’t a known property of ‘mat-date-range-input’ Shriram Kp on ERROR in ./ansi-html 1:0 Module parse failed: Unexpected character ‘#’ (1:0)

The current version of Chai no longer supports types different than 'any'.

So your suggestion to cast to 'any' is good.

Also the previous version before 4.2.0 still support all types, so using the previous version can solve it and use this with no issues:

let expectedValue : boolean = true;
expectedValue.should.equal(valueToTest);

https://github.com/chaijs/chai/issues/1100

Typescript 2 Type System: How Does it Really Work? Type , Error:(54, 6) TS2339:Property 'name' does not exist on type '{}'. So what is going here? We have defined an empty object first and then tried to� return json.property[0].index. where index was a variable. But it interpreted index, resulting in a: cannot find property "index" of json.property[0] And I had to find a workaround using your syntax: return json.property[0][index] It may be your only option there.

error TS2339: Property 'X' does not exist on type '{}' : Angular2, error TS2339: Property 'X' does not exist on type '{}'. Help Request. I'm trying to access these values safely - the values are always static and contain the same� The property 'value' does not exist on value of type 'HTMLElement' (6) A quick fix for this is use [ ] to select the attribute.

error TS2339: Property '_input' does not exist on type, An advice on how to fix these errors error TS2339: Property '_input' does not exist on type 'FileUpload'. error TS2339: Property '_input' does� ts2339 - property json does not exist on type object ionic 3 Property 'json' does not exist on type '{}' (6) I have an abstract base class in Typescript that looks like this:

Error TS2339: property 'rows' does not exist on type 'htmlelement , You need to cast the element returned from getElementById to an HTMLTableElement . Try: Hide Copy Code. var table� Issue The typescript type definition seems be slightly out of sync with the code. I have some simple working code that uses react-native-firebase. It runs without any issue. However, the typescript

Comments
  • hmm, I never worked with 'should' in context of typescript, but 'expect' worked fine. Btw. your code sample with the test and your later added imports seem not to match (as you import 'assert' in your sample)
  • 'expect' does not work for me (in this case). Like I said 'should' is working, and has NO error in Console, but it just gets underlined as an Error in Webstorm that 'should' does not exist on (in this case) 'expectedValue' or on true, or whatever, WebStorm tells me 'should' does not exist.