maxmarinich / react-alice-carousel

React responsive component for building content galleries, content rotators and any React carousels
MIT License
832 stars 91 forks source link

Encountering JS Error #322

Closed abhishek871 closed 1 month ago

abhishek871 commented 2 months ago

function(e, t, n) { "use strict"; Object.defineProperty(t, "esModule", { value: !0 }), t.DotsNavigation = void 0; var a = o(n(4)) , i = o(n(2)) , r = function(e) { if (e && e.esModule) return e; var t = {}; if (null != e) for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t.default = e, t }(n(315)); function o(e) { return e && e.esModule ? e : { default: e } } (t.DotsNavigation = function(e) { var t = e.state , n = e.onClick , i = e.onMouseEnter , o = e.onMouseLeave , s = t.slides , c = t.items , l = t.infinite , d = r.itemInfo(t).isNextSlideDisabled , p = r.getDotsNavigationLength(s.length, c); return a.default.createElement("ul", { className: "alice-carouseldots" }, s.map((function(e, u) { if (u < p) { var m = r.isTheLastDotIndex(u, l, p) , h = r.getItemIndexForDotNavigation(u, m, s.length, c) , f = r.getActiveSlideIndex(d, t) === u ? " active" : ""; return a.default.createElement("li", { key: "dot-item-" + u, onClick: function() { return n(h) }, onMouseEnter: i, onMouseLeave: o, className: "alice-carouseldots-item" + f }) } } ))) } ).propTypes = { state: i.default.object.isRequired, onClick: i.default.func.isRequired, onMouseEnter: i.default.func.isRequired, onMouseLeave: i.default.func.isRequired } },

For above code I am getting a JS Error : "TypeError: s.map is not a function at t.DotsNavigation [as constructor]".

Please help to resolve this JS error.As I think It only needs a sanity check to be taken before accessing .map over "s".

abhishek871 commented 1 month ago

Please help with this error resolution

maxmarinich commented 1 month ago

Hi, @abhishek871! The issue is related to the build settings.

shivamjuyal19 commented 1 month ago

Thanks @maxmarinich for fixing this.