Shouldn't I simply get the array without being wrapped in a proxy?

There's a number of variables involved here. If all your components have the same API version, are in the same namespace, the Apex method is @AuraEnabled(cacheable=false), and you're using Lightning Web Security, then you might end up receiving a plain Object/Array; I forget if there are additional rules, these are just the ones I recall. If any of these are not true, you're most likely going to get a Proxy. If the variable is bound to any markup, it will also become a Proxy immediately.

However, I feel this may be an X-Y Problem. Simply put, the Proxy is transparent, meaning that the executing code can't tell the difference between an Array and a Proxy that wraps an Array. The Proxy is only there to enforce certain rules (e.g. @api variables are meant to be read-only). Whatever problem you're having, except possibly the annoyance of having to open [[Target]] to visually debug objects, the Proxy is not likely the problem.

Answer from sfdcfox on Stack Exchange
🌐
Reddit
reddit.com › r/learnjavascript › cannot use json.parse on stringifyed object
r/learnjavascript on Reddit: Cannot use JSON.parse on stringifyed object
October 7, 2022 -

Hello,

I am trying to parse a string without success using JSON.parse(). I was able to stringify the original object without much trouble.

Can someone help me please ?

Original object:

'929920425': {

data: '{"users":[{"name":"Adriel","id":"ckz1fv9ok00029cvuop85wiba","__typename":"User"}]}'

}

Here is the string:

'{"929920425":{"data":"{\"users\":[{\"name\":\"Adriel\",\"id\":\"ckz1fv9ok00029cvuop85wiba\",\"__typename\":\"User\"}]}"}}'

🌐
Medium
medium.com › @pmzubar › why-json-parse-json-stringify-is-a-bad-practice-to-clone-an-object-in-javascript-b28ac5e36521
Why use JSON “parse” and “stringify” methods a bad practice to clone objects in JavaScript (2023 update) | by Petro Zubar | Medium
October 10, 2023 - By the way, as for me, one of the biggest problems of cloning with JSON.stringify() is that methods are not supported by it · Sometimes, JSON.stringify() pretends to be smart and converts some unsupported data types to supported ones. So, in cases like these, everything will be converted to {"key": null}: JSON.stringify({ key: Nan }); // {"key": null} JSON.stringify({ key: Infinity }); // {"key": null} Finally, there is a problem with the Date(). Dates will be parsed as Strings, not as Dates.
Discussions

why JSON.stringify() and JSON.parse does not work?
I have this javascript result: var layer = '{"type":"polygon", "coordinates": "-34.32982832836202 149.88922119140625, -34.80027235055681 149.80682373046875, -34. More on stackoverflow.com
🌐 stackoverflow.com
JSON.parse throwing error parsing something that came from JSON.stringify
Any chance the EOF character is breaking the JSON string validity? You should be able to require in JSON and not even need to stringify JSON btw. Edit: also I assume .map is sync and writing to file is async and not returning anything.. probably best to use foreach there More on reddit.com
🌐 r/learnjavascript
5
10
June 5, 2018
Javascript JSON.stringify function is not working - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I have tried to convert a JS object into JSON. ... Native JSON stringify is not working as expected. JSON stringify executes toJSON function in JS object internally. More on stackoverflow.com
🌐 stackoverflow.com
JSON parsing not working
To quote from mdn web docs article on JSON.parse() : The JSON.parse() method parses a JSON string..... I feel the missing quotes around what you have posted (reproduced below) is causing the error you are seeing: Current: { "success": true, "query": { "from": "USD", "to": "HKD", "amount": 1 }, "info": { "timestamp": 1660293003, "rate": 7.835385 }, "date": "2022-08-12", "result": 7.835385 }. Expected: '{ "success": true, "query": { "from": "USD", "to": "HKD", "amount": 1 }, "info": { "timestamp": 1660293003, "rate": 7.835385 }, "date": "2022-08-12", "result": 7.835385 }' In a browser console, if I use stringify what you posted above and then parse it, it seems to work. You can try if it works in React too: JSON.parse(JSON.stringify({ "success": true, "query": { "from": "USD", "to": "HKD", "amount": 1 }, "info": { "timestamp": 1660293003, "rate": 7.835385 }, "date": "2022-08-12", "result": 7.835385 })) More on reddit.com
🌐 r/learnjavascript
4
1
August 12, 2022
🌐
Medium
medium.com › @AlexanderObregon › what-happens-during-json-stringify-and-json-parse-in-javascript-38ea049e24e4
How JSON.stringify and JSON.parse Work in JS | Medium
May 14, 2025 - What comes out of JSON.parse is just a regular object with the same properties. The link to the class is lost. It doesn’t know about the constructor or any methods you attached to the class. All of that existed in memory, not in the string, so the parser never saw it in the first place. That’s not a bug. It’s just how JSON works.
🌐
DigitalOcean
digitalocean.com › community › tutorials › js-json-parse-stringify
How To Use JSON.parse() and JSON.stringify() | DigitalOcean
November 24, 2021 - The JSON object, available in all modern browsers, has two useful methods to deal with JSON-formatted content: parse and stringify. JSON.parse() takes a JSON string and transforms it into a JavaScript object. let userStr = '{"name":"Sammy","email":"sammy@example.com","plan":"Pro"}'; let userObj = JSON.parse(userStr); console.log(userObj); Executing this code will produce the following output: Output{name: 'Sammy', email: 'sammy@example.com', plan: 'Pro'} email: "sammy@example.com" name: "Sammy" plan: "Pro" Trailing commas are not valid in JSON, so JSON.parse() throws an error if the string passed to it has trailing commas.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › JSON › stringify
JSON.stringify() - JavaScript - MDN Web Docs
undefined, Function, and Symbol values are not valid JSON values. If any such values are encountered during conversion, they are either omitted (when found in an object) or changed to null (when found in an array). JSON.stringify() can return undefined when passing in "pure" values like JSON.stringify(() => {}) or JSON.stringify(undefined).
🌐
Squash
squash.io › how-to-use-js-json-parse-stringify-in-javascript
How to Use the JSON.parse() Stringify in Javascript
To solve this, ensure that your object does not contain circular references before calling JSON.stringify(). 2. TypeError: If the object being stringified contains properties with values that cannot be serialized (such as functions or undefined), ...
Find elsewhere
🌐
Reddit
reddit.com › r/learnjavascript › json.parse throwing error parsing something that came from json.stringify
r/learnjavascript on Reddit: JSON.parse throwing error parsing something that came from JSON.stringify
June 5, 2018 -
const fse = require('fs-extra');

function generateJSONFilePath(media) {
  const file_path = __dirname + `\\medias\\${media.constructor.name}\\${media.file_name}.json`;
  console.log(`Generated JSON file path: ${file_path}`);
  return file_path;
}

function getObjectFromJSONFile(file_path) {
  return new Promise((resolve, reject) => {
    fse.readFile(file_path, {encoding:'utf8'})
    .then((data) => {
      try {
        return JSON.parse(data);
      } catch (e) {
        console.log(file_path);
        throw e;
      }
    })
    .then(resolve)
    .catch(reject);
  });
}

medias.map((media) => {
  return fse.writeFile(generateJSONFilePath(media), JSON.stringify(media));
})

...

json_files.map((json_file) => {
  // returns promise for reading JSON file to Promise.all
  return getObjectFromJSONFile(path + '\\' + json_file);
})

So the above code is cherry picked from a much larger NodeJS script, but essentially what's happening is that I'm creating some objects (of class Media), then storing them as JSON in JSON files. Then, later in my code, I check to see if there are any JSON files to read from (for medias that were created last time the script ran). As you can see, I'm using JSON.stringify() to write the objects to the JSON files, and I'm using JSON.parse() to parse the files after reading them. But for some reason, I keep getting errors being thrown by the JSON.parse() called, complaining about unexpected characters. Even if I run the script twice immediately, without modifying the JSON files in any way, I still get these errors...and if I look at the JSON itself, I can see the characters it's complaining about (sometimes it's a comma, sometimes a number, it's different for each file).

So if I'm quite literally using JSON.stringify() to write to a file, then reading it with JSON.parse() without modifying it at any point in between, why wouldn't the parse be working? Could it have something to do with the process of writing to the file? The fs-extra module I'm using is supposedly a drop in replacement for the fs module, and I've definitely done JSON read/writes before...

I think I'm mainly looking for ideas on what could be going wrong, as it's obviously pretty hard to tell from afar. I could show my whole script, and I'm glad to if someone actually wanted to take a look at it, but I'm certain nothing is happening to modify the files in any way...and the stringify never throws errors, only the parse...

Full code just in case but...it's a lot...

🌐
DevToolbox
devtoolbox.dedyn.io › home › blog › json.stringify() and json.parse() guide
JSON.stringify() and JSON.parse(): The Complete Developer Guide for 2026 | DevToolbox Blog
February 11, 2026 - Always use JSON.stringify() when you need a string representation that can be parsed back into a value. JSON.stringify() returns undefined (not the string "undefined") when called with undefined, a function, or a Symbol as the root value. These types have no JSON representation.
🌐
Medium
medium.com › @debbie.obrien › json-parse-v-json-stringify-4b9d104c78d0
JSON Parse v JSON Stringify. I always get confused between the JSON… | by Debbie O'Brien | Medium
May 28, 2018 - JSON.stringify() can take 2 additional arguments. The first one being a replacer function and the second a string or number value to use as a space in the returned string. It can also be used to filter out values as those values that returned as undefined will not be returned in the string.
🌐
DEV Community
dev.to › katherineh › jsonstringify-jsonparse-1585
JSON.stringify() & JSON.parse() - DEV Community
November 18, 2024 - The JSON.stringify() Function accepts up to three parameters: Value: the Object or Array to convert to a JSON String (in this case, albums). Replacer(Optional): a Function that lets you modify each key-value pair. Set to null if not needed.
🌐
Execute Program
executeprogram.com › courses › modern-javascript › lessons › json-stringify-and-parse
Modern JavaScript: JSON Stringify and Parse
Learn programming languages like TypeScript, Python, JavaScript, SQL, and regular expressions. Interactive with real code examples.
🌐
Reddit
reddit.com › r/learnjavascript › json parsing not working
r/learnjavascript on Reddit: JSON parsing not working
August 12, 2022 -

I'm trying to write a React program which involves parsing JSONs downloaded form the internet. However, it seems it is unable to parse any JSONs, since even if I manually type out a JSON for it to parse, it gives the following error:

Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Here is an example of a JSON it is meant to parse:

{ "success": true, "query": { "from": "USD", "to": "HKD", "amount": 1 }, "info": { "timestamp": 1660293003, "rate": 7.835385 }, "date": "2022-08-12", "result": 7.835385 }

I am using Visual Studio Code, if that makes any difference.

🌐
Stack Overflow
stackoverflow.com › questions › 53684189 › why-is-json-parsejson-stringifyjson-json
parsing - Why is JSON.parse(JSON.stringify(json)) != json? - Stack Overflow
That is because objects and arrays in javascript are evaluated with there references. When you are doing JSON.parse(JSON.stringify(responseJson)) a new array is created with new reference.
🌐
W3Schools
w3schools.com › js › js_json_stringify.asp
JavaScript JSON.stringify()
The JSON.stringify() method converts a JavaScript value into JSON text.
🌐
CloudSigma
blog.cloudsigma.com › a-tutorial-on-working-with-json-parse-and-json-stringify
A Tutorial on Working with JSON.parse() and JSON.stringify() — CloudSigma
A common problem is when trailing commas are added to the string, so JSON.parse() throws an error if the string passed to it has trailing commas. If you need to manipulate the values, you can pass in the callbackfunction as a second argument. ... The stringify method does exactly the opposite ...
🌐
PTC Community
community.ptc.com › t5 › ThingWorx-Developers › Unable-to-use-JSON-stringify-on-a-JSON › td-p › 839345
Solved: Unable to use JSON.stringify() on a JSON - PTC Community
January 10, 2023 - String(new Date((TimestampValue)).toISOString()). Now we are not using the stringify(), but the above code instead. ... I created a service with input type JSON and output type string and executed following code result = JSON.stringify(jsonInput); It executed without any error when I passed your JSON in input. ... Please find the file attached. ... is used to query the location history of an asset and that data table is passed to the next function to convert it to JSON ... The JSON that you parsed previously, we got it by converting the infotable to JSON using preparePayload().