To parse it you need to use double quotes instead of single.

This should work:

services = '["service1", "service2", "service3"]'
JSON.parse(services)
Answer from Erick R Soto on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › string-to-array-in-javascript
JavaScript - Convert String to Array - GeeksforGeeks
August 5, 2025 - The Array.from() method can convert a string into an array of characters. This method is especially useful if you want to create an array from an iterable object, like a string, without needing to specify a separator.
Discussions

JavaScript - Converting string-array to an array of strings - Stack Overflow
However, I would like to convert this string, into a formal array of strings. ... I get object. I have tried JSON.parse() and JSON.stringify but to no luck. The basics of my question are how do I (in JavaScript) convert a string array, into an array of strings? More on stackoverflow.com
🌐 stackoverflow.com
Converting a String Array into an Array
This has nothing to do with Nextjs at all…? It’s a plain and simple JS question. Anyway the data format is obviously wrong. Perhaps you should look into making dynamoDB storing the data in a valid JSON format so you can just parse it. Trying to parse a JSON-like string is just unnecessary work when you could’ve fixed the source formatting instead. More on reddit.com
🌐 r/nextjs
4
0
August 4, 2023
javascript - Convert string with commas to array - Stack Overflow
In this case alert shows 0,1. If it where an array, it would show 0. And if alert(array[1]) is called, it should pop-up 1 · Is there any chance to convert such string into a JavaScript array? More on stackoverflow.com
🌐 stackoverflow.com
Convert array of key:value pair objects to string
There are two main approaches for this. The first is pretty straightfoward: do the first bits, then join: data.map(({ name, value }) => `${name}=${value}`).join('/'); You first join the data into an array like this ['a=b', 'c=d', 'e=f'] than just use the String join() function to join those with slashes. The slightly fancier way would be to use .reduce(): data.reduce((str, { name, value }) => `${str}${str ? '/' : ''}${name}=${value}`, '') This one you're just adding each onto the string. This one is a little harder to read, but has the advantage of only one loop through the data instead of two like the other. Better if you're getting lots of data (hundreds or thousands of records). The ternary bit in there (?:) is simply to ensure you don't get a "/" at the start of the string. More on reddit.com
🌐 r/learnjavascript
9
2
March 19, 2021
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript - MDN Web Docs
1 week ago - The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.
🌐
Stack Abuse
stackabuse.com › how-to-convert-a-string-to-an-array-in-javascript
How to Convert a String to an Array in JavaScript
May 22, 2023 - The from() method from the Array class is the leading contender to the split() method. It's used to create an array, given a source of data - and naturally, it can be used to create an array from an iterable string:
🌐
Board Infinity
boardinfinity.com › blog › string-to-array-conversion-in-javascript
String to Array conversion in JavaScript | Board Infinity
June 13, 2026 - If you want to split a string by a specific pattern or if you want to explore more options in the string-to-array conversion in javascript like finding specific characters then you can use .match() function in combination with regular expression.
🌐
DEV Community
dev.to › sanchithasr › 6-ways-to-convert-a-string-to-an-array-in-javascript-1cjg
6 Ways to Convert a String to an Array in JavaScript - DEV Community
September 24, 2022 - Converting from string to array is always done using the split() method but after ES6, there are many tools we could do the same.
Find elsewhere
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
Next up, you'll be checking out the .split() method, which is like the inverse of .join(). It's used to convert a string to an array. Say you had a string that represented some numbers: ... Perhaps this is what you got from a form input, as ...
🌐
Delft Stack
delftstack.com › home › howto › javascript › convert string to array javascript
How to Convert String Into Array in JavaScript | Delft Stack
February 2, 2024 - For example, create a variable num and store a value 1234 as a string in the variable. Call the from() method with an object Array and supply the num variable as the parameter in the function. Store the expression in a variable arr.
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-convert-array-of-strings-to-array-of-numbers-in-javascript
How to convert array of strings to array of numbers in JavaScript ? | GeeksforGeeks
September 23, 2024 - Converting an array of strings to an array of numbers in JavaScript involves transforming each string element into a numerical value.
🌐
ReqBin
reqbin.com › code › javascript › jaarxzpl › javascript-string-to-array-example
How do I convert string to array in JavaScript?
March 9, 2023 - The Array.from() method in JavaScript is used to create an array from any iterable object. The from() method returns a new array instance whose elements correspond to each element in the iterable.
🌐
W3Schools
w3schools.com › jsref › jsref_tostring_array.asp
JavaScript Array toString() Method
The toString() method returns a string with array values separated by commas. The toString() method does not change the original array. Every JavaScript object has a toString() method.
🌐
Reddit
reddit.com › r/nextjs › converting a string array into an array
r/nextjs on Reddit: Converting a String Array into an Array
August 4, 2023 -

So im trying to convert an array that was turned into a string from DynoDB. I got it formatted properly but I cant get it to work. (Incase you are wondering what this is for, its for a log keeping track of changes to a db. This is just showing the string with its state)

Here is the string:
"{PK:PHOTO01H70M6DC9YW6KPJBF15DQKDBF, SK:PHOTO01H70M6DC9YW6KPJBF15DQKDBF, type:photo, date:2023-08-02, dateRangeStart:null, dateRangeEnd:null, year:2023, featured:null, title:Title test, description:Adfsdf, linkAddress:null, location:Alberta, tags:[], people:[Free Press, School Division], bucket:bucket, region:null, key:null, filename:Screenshot 2023-07-19 at 13-44-34 Admin Add Files.png, filedesc:null, dateSK:2023-08-02#dodeyby, uploadedBy:deathbyunknown, createdAt:2023-08-04T15:55:54.644Z, updatedAt:2023-08-04T15:58:20.579Z}"

Things I've tried:
Convert using Object.entrys(), Result is an array with all the characters as a single item in the array.
JSON.parse(), Result error message: JSON.parse: expected property name or '}' at line 1 column 2 of the JSON data.

EDIT: Santizied Information that shouldn't be shown

🌐
GeeksforGeeks
geeksforgeeks.org › string-to-array-in-javascript
JavaScript – Convert String to Array | GeeksforGeeks
April 28, 2025 - This method copies the values of all enumerable properties from source objects(one or more) to a target object.JavaScriptlet a = [1, 2, 3, ... This article will show you how to convert a string of objects to an array in JavaScript. You have a string representing objects, and you need to convert it into an actual array of objects for further processing.
🌐
YouTube
youtube.com › watch
javascript : convert string array to array - YouTube
how to convert string array to array in javascript.
Published: November 1, 2015
🌐
Educative
educative.io › answers › how-to-convert-a-string-into-an-array-in-javascript
How to convert a string into an array in JavaScript
The split() method can be used to split a string based on the separator provided and return an array of substrings. This method works better if you want to create an array of strings.
🌐
Altcademy
altcademy.com › blog › how-to-convert-string-to-array-in-javascript
How to convert string to array in JavaScript - Altcademy.com
June 9, 2023 - In JavaScript, you can create an array using square brackets ([]). Here's an example: ... In this example, myArray is an array containing five elements: the numbers 1, 2, 3, 4, and 5. There are many reasons why you might want to convert a string to an array in JavaScript.
🌐
SamanthaMing
samanthaming.com › tidbits › 83-4-ways-to-convert-string-to-character-array
4 Ways to Convert String to Character Array in JavaScript | SamanthaMing.com
Here are 4 ways to split a word into an array of characters. "Split" is the most common and more robust way. But with the addition of ES6, there are more tools in the JS arsenal to play with 🧰 · I always like to see all the possible ways to solve something because then you can choose the best way for your use case. Also, when you see it pop up in someone's codebase, you will understand it with ease 👍‬ · const string = 'word'; // Option 1 string.split(''); // Option 2 [...string]; // Option 3 Array.from(string); // Option 4 Object.assign([], string); // Result: // ['w', 'o', 'r', 'd']
🌐
GoLinuxCloud
golinuxcloud.com › home › programming › javascript › convert string to array javascript (split, array.from, unicode)
Convert string to array JavaScript (split, Array.from, Unicode)
June 16, 2026 - Use split for delimited string to array javascript and convert string to array js token lists; add regex when multiple separators exist.