FormidableLabs / FormidableLabs/nuka-carousel

Carousel throws error inside server component

Open
#1,094 0 comments 0 reactions 0 assignees View on GitHub
Good first issue Issue: Accepted
Dominant language
TypeScript
Stars
3.1k
Forks
588
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

### Code Sandbox link

https://codesandbox.io/p/devbox/zcfnc2

### Bug report

```markdown
The Carousel component throws an error when used in a server component in NextJS 15:
> TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it.

This is because the component makes use of a context but is not marked as a client component.

As a work around, I can wrap the Carousel in a client component that just forwards props, but if a context is essential to it's operations it should be marked as a client component with "use client".
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.