GithubHelp home page GithubHelp logo

Non RSC authExchange failing about urql HOT 2 CLOSED

Nohac avatar Nohac commented on June 3, 2024
Non RSC authExchange failing

from urql.

Comments (2)

JoviDeCroock avatar JoviDeCroock commented on June 3, 2024

I don't think you should be able to call server-actions from non-DOM interactions 😅 as what seems to basically be happening is that the connection is closed immediately. It also tries to tell you this

Warning: Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.

As the server-action will try to update state on a component that doesn't exist yet. We'd probably also have to catch the action into a loading state, not sure whether server-actions are subject to Suspense but if they are then in this case it happens outside of a component and it might be hard for React to figure out where this belongs.

from urql.

Nohac avatar Nohac commented on June 3, 2024

You're right. I was following this guide and it looked like I could use server actions like a normal async function.

Moving from action to a normal api for subsequent fetches, and passing the token from RSC to the provider on initial render made the issues go away.

from urql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.