Closed Bobeta closed 5 years ago
@Bobeta hi, this seems to be something related with the configuration of your project, otherwise could be related to the library itself, so you should open a issue in the original plugin https://github.com/ganlanyuan/tiny-slider
@jechav The issue happens in this fork of tiny-slider that this package uses: https://github.com/jechav/tiny-slider
The newest version of tiny-slider
seems to have fixed the issue, which could be related to missing export
in ./helpers/keys
. The ./helpers/keys
looks to be inlined in the latest version of ´tiny-slider`.
@Bobeta Are you using SSR of some kind? I'm guessing the issue is Node.js or Webpack complaining about ES Modules.
hi, Any news about this issue ? FYI I'm doing SSR with NextJs
@CyrilQuandalle I ended up writing my own wrapper for tiny-slider
Hi @VilhelmNielsen, Thank you for your answer. On my side I ended up coding my own slider from scratch 😉
@VilhelmNielsen Could you share it with us? 👍
@Bobeta Here's a fairly simplified version, it should work: https://gist.github.com/VilhelmNielsen/2b87c4dd00b9e2e074ab346c2c2f80fb
@VilhelmNielsen's wrapper works well for me. Thanks! The only way I could get it to work server-side with Next.js was to import it dynamically though:
import dynamic from 'next/dynamic'
const Slider = dynamic(() => import('~/components/Slider'),
{
ssr: false,
},
)
...
<Slider>
<img src="/static/image1.png" />
<img src="/static/image2.png" />
<img src="/static/image3.png" />
</Slider>
@Bobeta Now the original library is compiled so shouldn't be any problem.
Tried with the sample code from the demo, but I get the following error:
Uncaught SyntaxError: Unexpected string - commons.js:54025