davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.37k stars 164 forks source link

[Bug]: Angular autoplay error #788

Closed sjostedtmax closed 3 months ago

sjostedtmax commented 3 months ago

Which variants of Embla Carousel are you using?

Steps to reproduce

The bug occurs when I add the autoplay feature to a angular project, it seems to work the first time i run it. But every time after it produces this error

Error: node_modules/embla-carousel-autoplay/components/Autoplay.d.ts:5:9 - error TS2411: Property 'autoplay' of type 'AutoplayType | undefined' is not assignable to 'string' index type 'CreatePluginType<LoosePluginType, {}>'.  

5         autoplay?: AutoplayType;

I am not using the angular wrapper

Expected Behavior

Fancy feature should have...

Additional Context

Changing this line in embla-carousel-autoplay/components/Autplay.d.ts seems to fix the issue. Probably not a good idea.

   interface EmblaPluginsType {
        autoplay?: string;
    }

What browsers are you seeing the problem on?

No response

Version

v8.0.0

CodeSandbox

No response

Before submitting

davidjerleke commented 3 months ago

Hi @sjostedtmax,

The embla-carousel-angular package is a separate repository and I'm not maintaining it. Please create a bug there first. The Autoplay plugin is working fine with all other library wrappers so it could be related to the angular wrapper.

Best, David