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
3k stars 596 forks source link

v6: Can't resolve 'react/jsx-runtime' in '/usr/src/app/node_modules/nuka-carousel/dist' #1014

Closed esetnik closed 1 year ago

esetnik commented 1 year ago

Bugs and Questions

Prerequisites

Describe Your Environment

Describe the Problem

Using create-react-app and installing the latest version of nuka-carousel causes build step to fail with a compilation error.

#16 2.213 Creating an optimized production build...
#16 39.49 Failed to compile.
#16 39.49 
#16 39.49 Module not found: Error: Can't resolve 'react/jsx-runtime' in '/usr/src/app/node_modules/nuka-carousel/dist'
#16 39.49 Did you mean 'jsx-runtime.js'?
#16 39.49 BREAKING CHANGE: The request 'react/jsx-runtime' failed to resolve only because it was resolved as fully specified
#16 39.49 (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
#16 39.49 The extension in the request is mandatory for it to be fully specified.
#16 39.49 Add the extension to the request.
#16 39.49 
#16 39.49 
#16 39.59 error Command failed with exit code 1.
#16 39.59 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#16 ERROR: executor failed running [/bin/sh -c REACT_APP_ENV=$REACT_APP_ENV yarn build]: exit code: 

Expected behavior:

Working the same way as v5

Actual behavior

Fail to compile on v6 in create-react-app environment

Additional Information

LetsPoke commented 1 year ago

any updates on that? facing the same problem right now after updating dependencies

carloskelly13 commented 1 year ago

Hi, we made a mistake in not setting the peer dependency for v6 to React 18, and will be fixing that in a patch. stepping up to React 18 should resolve this issue in how the jsx runtime is imported.