Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set properties on null #391

Closed
nandi95 opened this issue Sep 4, 2024 · 0 comments · Fixed by #427
Closed

Cannot set properties on null #391

nandi95 opened this issue Sep 4, 2024 · 0 comments · Fixed by #427
Labels
🐛 bug Something isn't working

Comments

@nandi95
Copy link

nandi95 commented Sep 4, 2024

Describe the bug
Recieving bug in SSR (nuxt) Cannot set properties on null (setting 'index')

I tracked the issue to this line:

(el: typeof SlideComponent, index: number) => (el.props.index = index)

To Reproduce
Steps to reproduce the behavior:
Use the carousel in the following manner:

<Carousel class="max-h-96 w-screen xl:max-h-[36rem]"
          :options="{ pauseAutoplayOnHover: true, wrapAround: true, autoplay: 5000 }">
    <Slide>
        <NuxtImg sizes="100vw"
                 class="min-h-56 min-w-full object-cover object-top"
                 src="..."
                 alt="Heading image" />
    </Slide>
    <template #addons>
        <Navigation />
    </template>
</Carousel>

Note that the <Slide> component has no attributes/props set.
If I do add :key="1" for example, everything works as expected.
This for some reason only trigger when using a production build.

Expected behavior
Being able to use the carousel without defining any props on the slides
Or specify on the docs that you must set some properties for the slide

Desktop (please complete the following information):

  • OS: OSX
  • Browser Firefox
  • Version 1.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants