Closed sboudouk closed 7 years ago
I noticed the same issue with node-webkit. Were you able to find a resolution to the issue? If so, can you share your findings?
I've just also had this problem.
the problem is that it checks whether window
is defined first, and creates a global. in electron (or browserify) window is defined, but so is module
.
it's only a two line change, just swap the order of this if-else https://github.com/phadej/relaxed-json/blob/master/relaxed-json.js#L577-L581 I would make a pull request, but it appears that this module is no longer maintained.
solution is to use hjson https://www.npmjs.com/package/hjson instead
+1 seems like on the client side in Meteorjs the require('relaxed-json') is resulting in an empty object. @phadej can you accept the pull request?
@phadej @dominictarr for Meteorjs, what works is removing the 'else' statement, like this:
/* global window, module */
if (typeof window !== "undefined") {
window.RJSON = RJSON;
}
if (typeof module !== "undefined") {
module.exports = RJSON;
}
@phadej can we include this patch?
The #14?
Yes that's correct. I have tested on meteor, not electron.
Hi.
I'm trying to use your relaxed-json in my Electron app. Here is a simple code,
GetDeviceList()
is triggered on a button-push action:The console.log show me an empty object. And I got an error message
Uncaught TypeError: relaxed.transform is not a function
.Otherwise, the package works properly when it's not used with electron.
Note that I don't encounter any
require
-related issue, so the modules must be valid isn't ?