Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

JSON.stringify is not a function #89

Open
alexkappa opened this issue Oct 6, 2016 · 2 comments
Open

JSON.stringify is not a function #89

alexkappa opened this issue Oct 6, 2016 · 2 comments

Comments

@alexkappa
Copy link

Hello,

I am having a strange issue with JSON.stringify when using browserify. Most times it works as expected, while I get an Uncaught TypeError: JSON.stringify is not a function error on certain pages of a website.

I suspect that window.JSON is somehow modified by another script running in the same page, but I thought that using require and browserify I could scope my own JSON object to use locally hopefully not affecting other definitions, or other scripts affecting mine.

For more context, here's how I use it:

var JSON = require('json3');

var MyObject = module.exports = function() {}

MyObject.prototype.doSomething() {
   // JSON.stringify({...})
}

Should I use the runInContect or noConflict helpers that were released recently? Have I missed something entirely?

Your help is much appreciated 😃

@maccman
Copy link

maccman commented Mar 20, 2018

Same here!

@aleksei-a-savitski
Copy link

I have this issue in Firefox and Safari but not in Chrome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants