question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Declare 'react' as a depdency in `embla-carousel` package

See original GitHub issue

Feature request is related to

  • The React version

Is your feature request related to an issue?

We can’t use the package in a yarn pnp enabled project.

The resolver throws the following error:

embla-carousel tried to access react, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Describe the solution you’d like

Updating the embla-carousel/package.json to move “react” from devDependencies into dependencies

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
davidjerlekecommented, Sep 22, 2021

@chitchu the dedicated react version is on its way (#220). This is what the package.json will look like.

1reaction
davidjerlekecommented, Sep 1, 2021

Hi Vicente (@chitchu),

Thank you for creating this issue. I don’t think the react package should be a dependency of the embla-carousel package? It should ideally be a peerDependency, because embla-carousel requires you to install react on your own. Embla shouldn’t include a duplicate react in the consumer project because this is known to cause a lot of problems. The reason why it’s not a peerDependency today has been discussed in the following issue #92.

In the future, I’m hoping to separate the react version into a separate package called embla-carousel-react, but I haven’t had the time to do so. Doing that will make it possible to move react to peerDependencies.

Best, David

Read more comments on GitHub >

github_iconTop Results From Across the Web

Declare 'react' as a depdency in embla-carousel package #212
We can't use the package in a yarn pnp enabled project. The resolver throws the following error: embla-carousel tried to access react, but...
Read more >
embla-carousel-react - npm
A lightweight carousel library with fluid motion and great swipe precision. Latest version: 7.0.2, last published: 5 days ago.
Read more >
React | Embla Carousel
Learn how to setup Embla Carousel using React. ... React. Start by installing the Embla Carousel npm package and add it to your...
Read more >
cms_base - NPM Package Overview - Socket - Socket.dev
Based on: React; Firebase; Mantine; Algolia; Tailwind; Wasabi. Instructions: First: yarn add cms_base. Most larger packages are included as peer dependencies ...
Read more >
React : unique id or classname of array based on index of ...
this is a carousel made using embla-react-carousel. i want to add a certain id or classname of each object in array because i...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found