When I try to use js-cookie, my javascript file can't seem to track down the Cookies variable from js.cookie-js.js. In my index.html file, I reference the script using this line of code:
<script src="/node_modules/js-cookie/src/js.cookie.js"></script>
In my index.js file, the first time I reference js-cookie, in order to check if any cookies have been established, I call this line of code:
if (!(Cookies.get('user_id'))) {
From there, I always get the following error:
ReferenceError: Cookies is not defined
at Namespace.<anonymous> (/Users/sourabh/sourabhmarathe.github.io/index.js:16:2)
at emitOne (events.js:116:13)
at Namespace.emit (events.js:211:7)
at Namespace.emit (/Users/sourabh/sourabhmarathe.github.io/node_modules/socket.io/lib/namespace.js:213:10)
at /Users/sourabh/sourabhmarathe.github.io/node_modules/socket.io/lib/namespace.js:181:14
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)