title: TypeError: Cannot read property 'userAgent' of undefined
body: <p>I am trying to integrate <a href="https://github.com/akiran/react-slick" rel="noreferrer">react-slick slider</a> into my ReactJS application.</p>
  
  <p>Its working as expected when I integrate it into a new demo app, but if I integrate it into my own application it throws an error.
  I am using rails as backend.</p>
  
  <p>When I try to import slider in component like</p>
  
  <pre><code> var Slider = require('react-slick'); 
  </code></pre>
  
  <p>it shows me an error.</p>
  
  <p>error logs (in rails) are</p>
  
  <pre><code>| ExecJS::ProgramError - TypeError: Cannot read property 'userAgent' of undefined:|   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:98:in `wrap_error'|   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:15:in `rescue in block in initialize'|   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:12:in `block in initialize' |   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:75:in `block in lock'|   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:73:in `lock'|   execjs (2.7.0) 
  lib/execjs/ruby_racer_runtime.rb:9:in `initialize'|   execjs (2.7.0) 
  </code></pre>
  
  <p>Edit</p>
  
  <p>Some where else in my code I have written below code and it's working fine</p>
  
  <pre><code>'use strict';
  
  var React = require('react');
  import logo from 'img/spark-logo.jpg'
  var Carousel = require('nuka-carousel');
  //import { NukaDecorate } from 'nuka-carousel-autoscroll';
  
  
  class App1 extends React.Component{
  
    // mixins: [Carousel.ControllerMixin],
    render() {
      return (
        &lt;Carousel&gt;
          &lt;img src={logo} alt="Smiley face" /&gt;
          &lt;img src="http://placehold.it/1000x400/ffffff/c0392b/&amp;text=slide2"/&gt;
          &lt;img src="http://placehold.it/1000x400/ffffff/c0392b/&amp;text=slide3"/&gt;   
        &lt;/Carousel&gt;
      )
    }
  }
  
  module.exports = App1; 
  </code></pre>