question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`@sapui5/ts-types-esm` - compile errors with typescript `strict` flag

See original GitHub issue

tsc output

node_modules/@sapui5/ts-types-esm/types/sap.ui.comp.d.ts:3412:5 - error TS2416: Property 'getVisibleInFilterBar' in type 'FilterGroupItem' is not assignable to the same property in base type 'FilterItem'.
  Type 'undefined' is not assignable to type '() => boolean'.

3412     getVisibleInFilterBar: undefined;
         ~~~~~~~~~~~~~~~~~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.comp.d.ts:15766:5 - error TS2416: Property 'search' in type 'SmartFilterBar' is not assignable to the same property in base type 'FilterBar'.
  Type '(bSync?: boolean | undefined) => boolean | undefined' is not assignable to type '() => boolean'.
    Type 'boolean | undefined' is not assignable to type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.

15766     search(
          ~~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.core.d.ts:33177:5 - error TS2416: Property 'getId' in type 'UIArea' is not assignable to the same property in base type 'ManagedObject'.
  Type '() => string | null' is not assignable to type '() => string'.
    Type 'string | null' is not assignable to type 'string'.
      Type 'null' is not assignable to type 'string'.

33177     getId(): string | null;
          ~~~~~

node_modules/@sapui5/ts-types-esm/types/sap.ui.vtm.d.ts:665:5 - error TS2416: Property 'setTooltip' in type 'Column' is not assignable to the same property in base type 'UI5Element'.
  Type '(sTooltip?: string | undefined) => this' is not assignable to type '(vTooltip: string | TooltipBase) => this'.
    Types of parameters 'sTooltip' and 'vTooltip' are incompatible.
      Type 'string | TooltipBase' is not assignable to type 'string | undefined'.
        Type 'TooltipBase' is not assignable to type 'string'.

665     setTooltip(
        ~~~~~~~~~~

tsconfig

{
    "compilerOptions": {
        "target": "es2018",
        "module": "es2015",
        "moduleResolution": "node",
        "declaration": true,
        "declarationMap": false,
        "skipLibCheck": false,
        "preserveConstEnums": true,
        "sourceMap": false,
        "allowJs": false,
        "strict": true,
        "strictNullChecks": true,
        "strictPropertyInitialization": true,
        "noImplicitAny": true,
        "strictFunctionTypes": true,
        "strictBindCallApply": true,
        "noImplicitThis": true,
        "alwaysStrict": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "noUncheckedIndexedAccess": true,
        "forceConsistentCasingInFileNames": true,
        "noPropertyAccessFromIndexSignature": true,
        "noImplicitOverride": true,
        "exactOptionalPropertyTypes": false,
        "allowUnreachableCode": false,
        "stripInternal": false,
        "esModuleInterop": true,
        "rootDir": "./src",
        "outDir": "./dist",
        "noEmit": true,
        "baseUrl": "./",
        "isolatedModules": true,
        "resolveJsonModule": true,
        "typeRoots": ["./node_modules/@types", "./node_modules/@sapui5/ts-types-esm"],
        "paths": {
            "thirdparty/*": ["./node_modules/*"]
        }
    },
    "include": ["./src/**/*", "./types/**/*"]
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DetachHeadcommented, Feb 4, 2022

all good, i know you guys close issues as soon as they are fixed rather than when the fix is released. as long as it’s been fixed that’s fine with me 😃

1reaction
DetachHeadcommented, Feb 3, 2022

@akudev one of the errors is still there in 1.98.0:

node_modules/@sapui5/ts-types-esm/types/sap.ui.comp.d.ts:15955:5 - error TS2416: Property 'search' in type 'SmartFilterBar' is not assignable to the same property in base type 'FilterBar'.
  Type '(bSync?: boolean | undefined) => boolean | undefined' is not assignable to type '() => boolean'.                                                                                    
    Type 'boolean | undefined' is not assignable to type 'boolean'.                                                                                                                         
      Type 'undefined' is not assignable to type 'boolean'.                                                                                                                                 
                                                                                                                                                                                            
15955     search(                                                                                                                                                                           
          ~~~~~~  

can this issue be re-opened or should i raise a new one?

Read more comments on GitHub >

github_iconTop Results From Across the Web

strict - TSConfig Option - TypeScript
How this setting affects your build.
Read more >
Consider using Typescript strict flag · Issue #6769 - GitHub
Great job on the Typescript Migration! strict is one of the most useful Typescript flags to catch cannot access key of undefined errors...
Read more >
The --strict Compiler Option in TypeScript - Marius Schulz
TypeScript 2.3 introduced a new --strict compiler option that enables a number of other compiler options related to stricter type checking.
Read more >
TypeScript "Strict" Flag Walkthrough - Miquido Blog
Learn more about how some of Typescript flags affect error catching at compilation time with our walkthrough. Visit our blog!
Read more >
How to Actually Improve Type Safety with the TypeScript Strict ...
The hard way. Another way to enable a strict compiler flag is to go through each error message from the compiler, one at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found