question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cookies.getJSON is not a function

See original GitHub issue

I just got your library from Bower (2.1.*) and included the JS file.

With the following code:

closedAlerts = Cookies.getJSON 'closed_alerts'

I get Cookies.getJSON is not a function error.

This code works:

closedAlerts = JSON.parse Cookies.get 'closed_alerts'

I check the vendor JS file and the getJSON is right here. Already had this issue?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
evictorcommented, Mar 20, 2020

My bad @carhartl I was referring to old docs for v2—https://www.npmjs.com/package/js-cookie

Curious why it was removed? Security concerns?

1reaction
carhartlcommented, Mar 20, 2020

@evictor

In v3 all built-in functionality related to handling json has been removed (it‘s mentioned in the release notes for the first beta).

I think this functionality was accidentally removed from library but is still documented in the README

Could you point me to where this is still documented, I can‘t seem to find it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

JQuery issue "TypeError: $.getJSON is not a function"
You seem to be using slim version of jquery which does not have the method getJSON thats why you are getting this error....
Read more >
js_cookie__WEBPACK_IMPORT...
Running into the following error when trying to build a Next.js app: TypeError: js_cookie__WEBPACK_IMPORTED_MODULE_2__.default.getJSON is not a function ...
Read more >
A simple, lightweight JavaScript API for handling cookies
getJSON = function () { return api.apply({ json: true }, [].slice.call(arguments)); } ... We're using "expires" because "max-age" is not supported by IE ......
Read more >
Uncaught TypeError: jQuery.getJSON is not a function
I have been following this guide on how to populate the graph with JSON from backend using .getJSON but i keep getting “Uncaught...
Read more >
TypeError: $.getJSON is not a function in jQuery | bobbyhadz
To solve the "$.getJSON is not a function" jQuery error, make sure to load the full version of the jQuery library. The slim...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found