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.

Bug: release 6.9.1 breaks TypeScript compiler (TSC) build

See original GitHub issue

Describe the bug

When I run tsc on my codebase with 6.9.1 I get a whole load of errors

To Reproduce

Run tsc

Expected behavior

No errors

Current behavior

Lots of errors, stacktrace as follows:

node_modules/express-validator/src/chain/context-runner-impl.ts(32,74): error TS7006: Parameter 'instance' implicitly has an 'any' type.
node_modules/express-validator/src/chain/sanitizers-impl.ts(1,28): error TS7016: Could not find a declaration file for module 'validator'. '/node_modules/validator/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/validator` if it exists or add a new declaration (.d.ts) file containing `declare module 'validator';`
node_modules/express-validator/src/chain/validators-impl.ts(1,28): error TS7016: Could not find a declaration file for module 'validator'. '/node_modules/validator/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/validator` if it exists or add a new declaration (.d.ts) file containing `declare module 'validator';`
node_modules/express-validator/src/context.ts(40,12): error TS2349: This expression is not callable.
  Type '{ default: LoDashStatic; VERSION: string; templateSettings: TemplateSettings; chunk<T>(array: List<T>, size?: number): T[][]; compact<T>(array: List<false | "" | 0 | T>): T[]; ... 302 more ...; uniqueId(prefix?: string): string; }' has no call signatures.
node_modules/express-validator/src/context.ts(42,17): error TS7006: Parameter 'instances' implicitly has an 'any' type.
node_modules/express-validator/src/context.ts(42,28): error TS7006: Parameter 'group' implicitly has an 'any' type.
node_modules/express-validator/src/context.ts(50,46): error TS7006: Parameter 'instance' implicitly has an 'any' type.
node_modules/express-validator/src/context.ts(56,15): error TS7006: Parameter 'instance' implicitly has an 'any' type.
node_modules/express-validator/src/matched-data.ts(26,10): error TS2349: This expression is not callable.
  Type '{ default: LoDashStatic; VERSION: string; templateSettings: TemplateSettings; chunk<T>(array: List<T>, size?: number): T[][]; compact<T>(array: List<false | "" | 0 | T>): T[]; ... 302 more ...; uniqueId(prefix?: string): string; }' has no call signatures.
node_modules/express-validator/src/matched-data.ts(29,10): error TS7006: Parameter 'field' implicitly has an 'any' type.
node_modules/express-validator/src/matched-data.ts(31,14): error TS7006: Parameter 'state' implicitly has an 'any' type.
node_modules/express-validator/src/matched-data.ts(31,21): error TS7006: Parameter 'instance' implicitly has an 'any' type.
node_modules/express-validator/src/matched-data.ts(38,27): error TS7006: Parameter 'instance' implicitly has an 'any' type.
node_modules/express-validator/src/select-fields.ts(11,3): error TS2349: This expression is not callable.
  Type '{ default: LoDashStatic; VERSION: string; templateSettings: TemplateSettings; chunk<T>(array: List<T>, size?: number): T[][]; compact<T>(array: List<false | "" | 0 | T>): T[]; ... 302 more ...; uniqueId(prefix?: string): string; }' has no call signatures.
node_modules/express-validator/src/select-fields.ts(12,14): error TS7006: Parameter 'field' implicitly has an 'any' type.

Express-validator version:

tsc works on 6.9.0 and earlier versions tsc breaks on 6.9.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
gustavohenkecommented, Jan 4, 2021

Republished as v6.9.2. Let me know if it doesn’t fix the issue.

1reaction
erezsdevcommented, Jan 4, 2021

Same here.

node_modules/express-validator/src/matched-data.ts:28:13 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(predicate: ListIteratorTypeGuard<boolean, boolean>): Collection<boolean>', gave the following error.
    Argument of type '(field: FieldInstanceBag) => boolean' is not assignable to parameter of type 'ListIteratorTypeGuard<boolean, boolean>'.
      Types of parameters 'field' and 'value' are incompatible.
        Type 'boolean' is not assignable to type 'FieldInstanceBag'.
  Overload 2 of 2, '(predicate?: ListIterateeCustom<boolean, boolean>): Collection<boolean>', gave the following error.
    Argument of type '(field: FieldInstanceBag) => boolean' is not assignable to parameter of type 'ListIterateeCustom<boolean, boolean>'.
      Type '(field: FieldInstanceBag) => boolean' is not assignable to type 'ListIterator<boolean, boolean>'.
        Types of parameters 'field' and 'value' are incompatible.
          Type 'boolean' is not assignable to type 'FieldInstanceBag'.

28     .filter(validityFilter)
               ~~~~~~~~~~~~~~

  node_modules/express-validator/src/matched-data.ts:28:13
    28     .filter(validityFilter)
                   ~~~~~~~~~~~~~~
    Did you mean to call this expression?

node_modules/express-validator/src/matched-data.ts:29:25 - error TS2339: Property 'instance' does not exist on type 'boolean'.

29     .map(field => field.instance)
                           ~~~~~~~~

node_modules/express-validator/src/middlewares/schema.ts:67:15 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(predicate: (value: string, index: number, array: string[]) => value is "replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | ... 93 more ... | "matches", thisArg?: any): ("replace" | ... 102 more ... | "matches")[]', gave the following error.
    Argument of type '(method: keyof ParamSchema) => method is "replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | "ltrim" | "normalizeEmail" | ... 91 more ... | "matches"' is not assignable to parameter of type '(value: string, 
index: number, array: string[]) => value is "replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | ... 93 more ... | "matches"'.
      Types of parameters 'method' and 'value' are incompatible.
        Type 'string' is not assignable to type '"replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "optional" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | "ltrim" | "normalizeEmail" | ... 93 more ... | "in"'.
  Overload 2 of 2, '(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[]', gave the following error.
    Argument of type '(method: keyof ParamSchema) => method is "replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | "ltrim" | "normalizeEmail" | ... 91 more ... | "matches"' is not assignable to parameter of type '(value: string, 
index: number, array: string[]) => unknown'.
      Types of parameters 'method' and 'value' are incompatible.
        Type 'string' is not assignable to type '"replace" | "toLowerCase" | "toUpperCase" | "trim" | "isEmpty" | "optional" | "customSanitizer" | "default" | "blacklist" | "escape" | "unescape" | "ltrim" | "normalizeEmail" | ... 93 more ... | "in"'.

67       .filter((method: keyof ParamSchema): method is keyof InternalParamSchema => {
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Found 3 errors.
Read more comments on GitHub >

github_iconTop Results From Across the Web

A brand new website interface for an even better experience!
Bug : release 6.9.1 breaks TypeScript compiler (TSC) build.
Read more >
Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
Error - [tsc] node_modules/@fluentui/react/lib/components ...
I am trying to develop this SPFX inside our SharePoint online site @ https://www.c-sharpcorner.com/article/modal-popup-in-spfx/.
Read more >
ts2349: this expression is not callable. type 'string' has no call ...
React - typescript TypeScript error: This expression is not callable ... release 6.9.1 breaks TypeScript compiler (TSC) build#973.
Read more >
TypeScript Compiling with Visual Studio Code
Under the covers, we run the TypeScript compiler as a task. The command we use is: tsc -p . Step 3: Make the...
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