JavaScript fetch() Syntax Error: “missing ) after argument list”

I’m encountering a “missing ) after argument list” error in my JavaScript code when trying to use the fetch() function to retrieve JSON data. Despite thorough review, I can’t pinpoint the source of the issue. Here’s the relevant code snippet:

fetch(myString)
  .then(response => response.json())
  .then(data => {
    initializeChat(data.chatMessages);
  })
  .catch(error => console.error("Failed to load chat messages:", error));