You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 28, 2019. It is now read-only.
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 😃
The text was updated successfully, but these errors were encountered:
Hello,
I am having a strange issue with
JSON.stringify
when using browserify. Most times it works as expected, while I get anUncaught 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 usingrequire
andbrowserify
I could scope my ownJSON
object to use locally hopefully not affecting other definitions, or other scripts affecting mine.For more context, here's how I use it:
Should I use the
runInContect
ornoConflict
helpers that were released recently? Have I missed something entirely?Your help is much appreciated 😃
The text was updated successfully, but these errors were encountered: