Skip to content

[BUG] Error: Interface 'ComponentOptions<T, V>' incorrectly extends interface 'ComponentSchema<T> & { [key: string]: any; }'. #958

@pauliax

Description

@pauliax

Environment

Please provide as many details as you can:

  • Hosting type
    • [x ] Local deployment
      • Version: "@formio/angular": "5.3.0",
  • Formio.js version: "formiojs": "^4.14.13",
  • Frontend framework: Angular (15.2.7)
  • strict mode: true

Steps to Reproduce

  1. I am trying to migrate from Angular v14 to v15.
  2. Angular 15 requires TypeScript version >= 4.8.2 and < 5.0.0.
  3. I have updated my dependencies as per the official guide: https://update.angular.io/?l=3&v=14.0-15.0
  4. When I run ng serve the compilation fails. Error is related to this formio package.

Expected behavior

Successful compilation.

Observed behavior

image

Error: node_modules/@formio/angular/formio.common.d.ts:4:18 - error TS2430: Interface 'ComponentOptions<T, V>' incorrectly extends interface 'ComponentSchema<T> & { [key: string]: any; }'.
  Type 'ComponentOptions<T, V>' is not assignable to type 'ComponentSchema<T>'.
    Types of property 'validate' are incompatible.
      Type 'V | undefined' is not assignable to type 'ValidateOptions | undefined'.
        Type 'V' is not assignable to type 'ValidateOptions | undefined'.
          Type 'V' is not assignable to type 'ValidateOptions'.

4 export interface ComponentOptions<T = any, V = ValidateOptions> extends ExtendedComponentSchema<T> {
                   ~~~~~~~~~~~~~~~~

  node_modules/@formio/angular/formio.common.d.ts:4:44
    4 export interface ComponentOptions<T = any, V = ValidateOptions> extends ExtendedComponentSchema<T> {
                                                 ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends ValidateOptions` constraint.
  node_modules/@formio/angular/formio.common.d.ts:4:44
    4 export interface ComponentOptions<T = any, V = ValidateOptions> extends ExtendedComponentSchema<T> {
                                                 ~~~~~~~~~~~~~~~~~~~
    This type parameter might need an `extends ValidateOptions | undefined` constraint.

Example

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions