last day (16 days later) » 

9:19 AM
0
Q: TypeError: Cannot read property 'userAgent' of undefined

AnishI am going to integrate slider in my reactJS application. https://github.com/akiran/react-slick its working as expected when i integrate in separate new demo app, but if i integate in my own application it through an error . i am using rails as backend When i try to import slider in component l...

 
@Tushar please see edits
 
As stated in the documentation, ExecJS doesn't support require().
Have you tried dropping the js code as the <script> tag in some main template?
 
@virzen some where else in my code i use require it works, and yes i create a demo-app and use slick it also works...
 
That's interesting. What is the difference in setup between your current app and the dome one, then?
 
@virzen please see edits....
 
9:20 AM
Ok, have you imported React before react-slick?
 
yes
nuka carousel its working fine but if i try to any other slider or carusel it starts giving an issue
 
Does this happen with any other package, or just with react-slick?
Oh, ok
Hm, what version of React do you use?
Also, what versions of react-slick and nuka-carousel?
 
9:52 AM
latest version
all latest version
"classnames": "^2.2.5",
"es6-promise": "^4.1.0",
"nuka-carousel": "^2.0.4",
"react": "^15.5.4",
"react-addons-shallow-compare": "^15.5.2",
"react-collapse": "^4.0.2",
"react-image-slider":"^0.1.0",
"react-dom": "^15.5.4",
"react-image-slideshow": "^1.5.2",
"react-motion": "^0.5.0",
"react-owl-carousel": "^0.14.0",
"react-owl-carousel2": "0.1.1",
"react-portal": "^3.1.0",
"react-responsive-carousel": "^3.1.5",
"react-slick": "^0.14.11",
"react-player":"^0.15.0",
"slick-carousel": "^1.6.0",
 
 
1 hour later…
10:56 AM
Well, I thought about it and searched a bit and can't come up with anything meaningful. Do you need to use react-slick in particular?
Maybe there is a slider which doesn't cause such error?
I suspect this error occurs because somewhere in the code navigator.userAgent is used, which doesn't exist in browserless environment like ExecJS
 

  last day (16 days later) »