DEV Community

Discussion on: React Splide with Gatsby: Top Tip

Collapse
 
zbr_aziz profile image
Zubair Aziz

Hi Jamie, I followed these steps and the build ran fine. But getting this error on the rendered HTML:

[SPLIDE] Track or list was not found.
j @ splide.esm.js:953
2react-dom.production.min.js:216 TypeError: Cannot read property 'length' of undefined
at Object.get length as length
at i.get (splide.esm.js:1838)
at Object.get edgeIndex as edgeIndex
at Object.handler (splide.esm.js:2755)
at splide.esm.js:139
at Array.forEach ()
at Object.emit (splide.esm.js:137)
at i.r.emit (splide.esm.js:1703)
at i.r.refresh (splide.esm.js:1772)
at m.value (Splide.js:208)

Collapse
 
animald profile image
animald

Hi, if you're still having issues I suggest you try reverting the changes made and importing node-self before your splider import.

The self is not defined error relates to self not being implemented in NodeJs - the above fixes that issue and the result should be a fully working SSR rendered splider. (At least that is the case in my Gridsome project).

Cheers!

Collapse
 
jamiebradley profile image
Jamie Bradley

Thanks @animald , appreciate the input!

Collapse
 
jamiebradley profile image
Jamie Bradley

Sorry for the delay Zubair, interesting as I've not seen this error before. I don't suppose this is related to Marco's comment regarding SSR during dev? I'm only asking with you saying that the build worked fine. I'm reading this as it worked during build phase but not dev phase. Thanks!