Closed coudron closed 4 years ago
Same and also it does not work with Nextjs ssr it requires window
Hello and thanks @coudron. I apologize this went completely under my radar as I have this repo on very low maintenance. A refactor is due. I apologize for having missed adding that note in the documentation 🤦
styled-components
is actually a peer dependency as you can see in the package.json, you'd need to install styled-components independently of this package.
By the way @istrapi, if by chance you're still looking to use the package, could you open an issue with more details to see what's going on? I did use this package in a Next.js SSR application, as shown here.
I get this same error even after installing styled-components, does it maybe only work with an older version of styled-components? The version I have installed is: "styled-components": "^5.1.1",
Module not found: Error: Can't resolve 'styled-components' in '/app/node_modules/hero-slider/dist' dashboard_1 | @ ./node_modules/hero-slider/dist/index.es.js
EDIT: nevermind, I got it working
@Wahagn thanks for the info & update, was your solution basically tinkering with the package.json
?
I'm thinking of refactoring the usage of styled-components while at the same time simply use CSS, and also adding support the styled-components
API and other CSS related ones by allowing components to receive classes/styles.
@rmolinamir
I uninstalled the 5.X.X version of styled-components, then I installed the version which was available at the time of this post (sept 1, 2019) which is 4.3.2 then I built my project with docker-compose for changes to take place. Not 100% sure whether it was the version change or the built was not totally successful the first time but it works now
@Wahagn thank you very much for the info. The component definitely needs to be refactored, much of the logic needs to be abstracted from the slider too, so I'll work on also refactoring the way I'm generating the CSS and make it package agnostic in the same update.
Closed this one and opened a new issue for the refactor:
Nice Sliders!
Heads up, there's some bug around
styled-components
dependencies. I was getting this error until I manually installedstyled-components
Cheers, Chris