FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3.06k stars 593 forks source link

Can't get nuka-carousel to work when added as a local package #905

Closed vala closed 2 years ago

vala commented 2 years ago

Bugs and Questions

Prerequisites

Feel free to delete this section if you have checked off all of the following.

Describe Your Environment

Master branch (5.0.16)

React 18.1.0 and Node 14

Firefox 100 (also fails on Chrome 102)

Describe the Problem

Reproduction repo : https://github.com/respublica-conseil/nuka-carousel-local-package-test

Just yarn (maybe yarn inside "vendor/packages/nuka-carousel" also ?) and then yarn start in the main directory. Go to http://localhost:3000 and see the error message in the console.

Technical context :

I cloned the nuka-carousel main branch into my project (in vendor/packages/nuka-carousel), then inside the directory did yarn and yarn build-v5 to build the needed files.

Expected behavior:

When I add nuka-carousel as a local package, I expect it to work as if I used it from the npm registry, to be able to test some code changes in the lib, and then reproduce them into the nuka test cases and propose them as new features or feature updates in one or more PRs.

Actual behavior:

When I use a locally built nuka-carousel package, I get an error during the nuka <Carousel> component mounting, which seems to tell that the carousel isn't a component.

Capture d’écran 2022-05-31 à 10 58 52

Additional Information

I'm trying to add some simple feature additions to make nuka-carousel fully accessible, or easy to make accessible, and would like to try to make those changes while testing them on my project.

I'd then add them to test cases in nuka-carousel.

Thanks for your help !

ValGeorgiev commented 2 years ago

Hey @vala I just cloned your repo, run yarn and then yarn start and it's working properly. Could you try again these steps, please? And let me know if it's still not working.

On the other side, I would recommend just use the nuka repo for such testing and playing.

  1. Clone nuka-carousel repo
  2. Run yarn on root level, run yarn on examples/nextjs level
  3. Run yarn start:next on root level
  4. Open localhost:3000 in the browser.

Now you can edit src-v5 and explore the changes in the browser.

vala commented 2 years ago

Hi @ValGeorgiev thanks for your quick answer ! Didn't expect it to be that fast ;)

Don't understand why it doesn't work for me but works for you .. I asked a coworker to test my repo, and it did work also. So this seems to be an issue with my system, since it also didn't work with another configuration between an external folder repo and the app I'm working on.

The alternative solution of using directly the nuka-carousel test app was my second choice to make my changes, but I'd have liked to also test the changes in my app, but I'll find a way later for that.

Thanks for your time and help, I'll close the issue and come back with a11y related PRs soon.