Closed xinqm0217 closed 4 years ago
const obj = { e: 123, f: 'str2', }; const str = JSON.stringify(obj); const result = superjson.parse(str);
ERROR Error: Not a valid SuperJSON payload.
You'll need to stringify using SuperJSON:
const obj = { e: 123, f: 'str2', }; const str = SuperJSON.stringify(obj); // 👈 you used JSON instead of SuperJSON const result = SuperJSON.parse(str);
const obj = { e: 123, f: 'str2', }; const str = JSON.stringify(obj); const result = superjson.parse(str);
ERROR Error: Not a valid SuperJSON payload.