question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Circular error with MongoDB Stitch authenticated user

See original GitHub issue

Hello all,

I’m using https://www.npmjs.com/package/mongodb-stitch-server-sdk with Typescript and I get circular error when I try to set user object to a state: client.auth.user

create.js:7 Uncaught TypeError: Converting circular structure to JSON --> starting at object with constructor 'StitchUserImpl' | property 'auth' -> object with constructor 'StitchAuthImpl' --- property 'currentUser' closes the circle at JSON.stringify (<anonymous>) at createKey (create.js:7) at Object.get key [as key] (create.js:19) at StoreRegistry.generateKey (registry.js:49) at registry.js:35 at useSweetState (hook.js:79) at LoginForm (LoginForm.tsx:16) at renderWithHooks (react-dom.development.js:14825) at mountIndeterminateComponent (react-dom.development.js:17505) at beginWork (react-dom.development.js:18629) at HTMLUnknownElement.callCallback (react-dom.development.js:188) at Object.invokeGuardedCallbackDev (react-dom.development.js:237) at invokeGuardedCallback (react-dom.development.js:292) at beginWork$1 (react-dom.development.js:23234) at performUnitOfWork (react-dom.development.js:22185) at workLoopSync (react-dom.development.js:22161) at performSyncWorkOnRoot (react-dom.development.js:21787) at scheduleUpdateOnFiber (react-dom.development.js:21219) at updateContainer (react-dom.development.js:24407) at react-dom.development.js:24792 at unbatchedUpdates (react-dom.development.js:21934) at legacyRenderSubtreeIntoContainer (react-dom.development.js:24791) at Object.hydrate (react-dom.development.js:24857) at renderReactElement (index.js:38) at doRender$ (index.js:44) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:271) at Generator.prototype.<computed> [as next] (runtime.js:97) at tryCatch (runtime.js:45) at invoke (runtime.js:135) at runtime.js:170 at new Promise (<anonymous>) at callInvokeWithMethodAndArg (runtime.js:169) at AsyncIterator.enqueue [as _invoke] (runtime.js:192) at AsyncIterator.prototype.<computed> [as next] (runtime.js:97) at Object.push../node_modules/next/node_modules/regenerator-runtime/runtime.js.exports.async (runtime.js:216) at doRender (index.js:40) at render$ (index.js:25) at tryCatch (runtime.js:45) at Generator.invoke [as _invoke] (runtime.js:271) at Generator.prototype.<computed> [as next] (runtime.js:97) at tryCatch (runtime.js:45) at invoke (runtime.js:135) at runtime.js:170 at new Promise (<anonymous>) at callInvokeWithMethodAndArg (runtime.js:169) at AsyncIterator.enqueue [as _invoke] (runtime.js:192) at AsyncIterator.prototype.<computed> [as next] (runtime.js:97) at Object.push../node_modules/next/node_modules/regenerator-runtime/runtime.js.exports.async (runtime.js:216) at render (index.js:25)

Appreciate looking at this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dawidjanigacommented, Apr 5, 2020

Got you @Trimud 👍I hope you resolve the problem and if not - I will be happy to help 😃

0reactions
albertogasparincommented, Apr 13, 2020

Closing for now as a workaround is possible. If someone else in future will report problem with JSON.stringify then will harden the logic around it

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved]-MongoDB Stitch throwing anon-user error-mongodb
First you must allow anonymous login. Allow Users to login anonymously. Click on the review and deploy changes at the top of the...
Read more >
Stitch Errors - MongoDB Stitch
Issue, The requesting individual has not authenticated with Stitch. In Stitch, a minimum of anonymous authentication is required for a user to make...
Read more >
Stitch User Auth: unknown user confirmation status "400 BAD ...
It turned out that the confirmation function had been adjusted and was not returning the required status:success/pending/fail message anymore.
Read more >
stitch-specifications/sdks.rst at master - GitHub
When an authenticated request is completed, it is possible that the response will contain a service error with the error code InvalidSession ....
Read more >
MongoDB Realm vs. Stitch login times - why is Realm so slow?
My round-trip performance averages around 600-800 ms. Chrome DevTools showing ~600 ms round-trip for Realm user auth. For my application (using ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found