You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the function async and await an action inside (e.g., testingAction)
Run wasp start, load localhost:3000 and see the blank white screen.
Code confirmed to cause the behavior:
import{testingAction}from'wasp/client/operations'import{sayHi}from'./util'exportdefaultasyncfunctionsetup(){console.log('This was called from the client setup function')awaittestingAction()sayHi()}
The text was updated successfully, but these errors were encountered:
@sodic why would this be a bug? It sounds to me like it is expected behaviour -> you put await in setup function for a client, of course rendering it postponed.
Here is from our docs about this function:
setupFn declares a Typescript function that Wasp executes on the client before everything else. It is expected to be asynchronous, and Wasp will await its completion before rendering the page. The function takes no arguments, and its return value is ignored.
You can use this function to perform any custom setup (e.g., setting up client-side periodic jobs).
So I would say this is expected, documented and desired behaviour! If you want to not wait for that action, you can just not await it.
Steps to reproduce:
waspc/todoApp/src/clientSetup.js
.async
andawait
an action inside (e.g.,testingAction
)wasp start
, load localhost:3000 and see the blank white screen.Code confirmed to cause the behavior:
The text was updated successfully, but these errors were encountered: