Skip to content

Typescript: Parcel config not compatible with system.import  #208

Description

@geedmo

Parcel component config prop seems to be not assignable with the result of system.import.
I'm updating to the latest versions provided by create-single-spa and suddenly found this error.
I'm not sure it's a bug, I haven't been able to find enough documentation for this particular case.

TS2769: No overload matches this call.
  Overload 1 of 2, '(props: ParcelCompProps<CustomProps> | Readonly<ParcelCompProps<CustomProps>>): Parcel<CustomProps>', gave the following error.
    Type '() => Promise<System.Module>' is not assignable to type 'ParcelConfig<CustomProps>'.
      Type '() => Promise<System.Module>' is not assignable to type '() => Promise<ParcelConfigObject<CustomProps>>'.
        Type 'Promise<Module>' is not assignable to type 'Promise<ParcelConfigObject<CustomProps>>'.
          Type 'Module' is not assignable to type 'ParcelConfigObject<CustomProps>'.
            Type 'Module' is missing the following properties from type 'LifeCycles<CustomProps>': bootstrap, mount, unmount
  Overload 2 of 2, '(props: ParcelCompProps<CustomProps>, context: any): Parcel<CustomProps>', gave the following error.
    Type '() => Promise<System.Module>' is not assignable to type 'ParcelConfig<CustomProps>'.
    17 |                 <Parcel
    18 |                     mountParcel={context ? context.mountParcel : null}
  > 19 |                     config={() => System.import(props.mfeName)}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions