solid-primitives icon indicating copy to clipboard operation
solid-primitives copied to clipboard

messageSync fails with invalid JSON when present with other librairies

Open jean343 opened this issue 10 months ago • 0 comments

Describe the bug

I am created a persisted signal with messageSync() and setting it this way.

  return makePersisted(createSignal(value, options), {
    sync: isServer ? undefined : messageSync(),
    storage: cookieStorage.withOptions!({ path: "/", sameSite: "Lax", secure: true }),
  });

The problem with messageSync is that it expects any messages on the domain to be a JSON string. In our app, we are getting JSON objects from "react-devtools-content-script". I would expect messageSync to accept any types of messages without throwing exceptions.

image

jean343 avatar Apr 03 '24 13:04 jean343