Browserify w/ NPM : Uncaught ReferenceError: getCookie is not defined
See original GitHub issueHi,
I try to use js-cookie with Browserify and NPM. I check my compiled JS files, js-cookie is inside, everything look fine.
But when I want to use function of js-cookie, I got this error :
Uncaught ReferenceError: getCookie is not defined
Am I doing something wrong ?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Getcookie not defined - jquery - Stack Overflow
Solved, needed to specify this: function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.
Read more >js-cookie - npm
A simple, lightweight JavaScript API for handling cookies. Latest version: 3.0.1, last published: a year ago. Start using js-cookie in your ...
Read more >Node.js Notes for Professionals
not a liated with o cial Node.js group(s) or company(s). ... Section 10.5: Extended project definition ... Section 47.1: /w Express,...
Read more >getCookie | API Reference - Nightwatch.js
Retrieve a single cookie visible to the current page. The cookie is returned as a cookie JSON object, as defined here. Uses cookie...
Read more >cookie-parser-browserify - npm package - Snyk
Create a new cookie parser middleware function using the given secret and options . secret a string or array used for signing cookies....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You’re welcome!
Guess, you should import the library, like this:
or if you use ES6 with babel + browserify, you can use import:
and later: