#Dynamic import package throws error

8 messages · Page 1 of 1 (latest)

barren bolt
#
    ssr: false
  });```

Why doesn't something like this work?

The error is huge
```Type error: Argument of type '() => Promise<ComponentClass<never, any> | FunctionComponent<never> | ComponentModule<never> | FC<ToasterProps>>' is not assignable to parameter of type 'DynamicOptions<ToasterProps> | Loader<ToasterProps>'.
  Type '() => Promise<ComponentClass<never, any> | FunctionComponent<never> | ComponentModule<never> | FC<ToasterProps>>' is not assignable to type '() => LoaderComponent<ToasterProps>'.
    Type 'Promise<ComponentClass<never, any> | FunctionComponent<never> | ComponentModule<never> | FC<ToasterProps>>' is not assignable to type 'LoaderComponent<ToasterProps>'.
      Type 'ComponentClass<never, any> | FunctionComponent<never> | ComponentModule<never> | FC<ToasterProps>' is not assignable to type 'ComponentType<ToasterProps> | ComponentModule<ToasterProps>'.
        Type 'ComponentClass<never, any>' is not assignable to type 'ComponentType<ToasterProps> | ComponentModule<ToasterProps>'.
          Type 'ComponentClass<never, any>' is not assignable to type 'ComponentClass<ToasterProps, any>'.
            Types of property 'getDerivedStateFromProps' are incompatible.
              Type 'GetDerivedStateFromProps<never, any> | undefined' is not assignable to type 'GetDerivedStateFromProps<ToasterProps, any> | undefined'.
                Type 'GetDerivedStateFromProps<never, any>' is not assignable to type 'GetDerivedStateFromProps<ToasterProps, any>'.
                  Types of parameters 'nextProps' and 'nextProps' are incompatible.
                    Type 'Readonly<ToasterProps>' is not assignable to type 'never'.```
humble mantle
#

this is on the client?

barren bolt
#

well that error is in VS Code, but I assume the client or build would throw that as well

humble mantle
#

can I see more of a view of the code

#

should be the solution your looking for hopefully

barren bolt
fallow solstice
#

The answer came 2 minutes after you asked the question, you just took a month to read it