I'm running into a weird issue where it shouts "In...
# support-questions
c
I'm running into a weird issue where it shouts "Initialisation not done. Did you forget to call the SuperTokens.init function?" even though I have done the initialisation and I have successfully fetched user data from Supertokens prior to the error, and successfully afterwards
This has now happened for the Session.getAllSessionHandlesForUser and the ThirdPartyPasswordless.getUserById functions
dunno, maybe Sails is weird
r
hey!
uhmm.. Well, you have to make sure that you call the init function before you use any of our functions.
Are you using Any other recipe other than Sessions and ThirdPartyPasswordless?
c
yes, plus UserMetadata
and I do call the init immediately when the app starts
r
right yea. Have you don UserMetadata.init in the recipeList?
c
yes
r
hmm
c
It does work before the error, and after
r
> It does work before the error, and after
What does this mean?
c
for example the ThirdPartyPasswordless.getUserById function. It works through many calls, then when I call it from this one place it doesn't
the place it doesn't work is a Sails controller, so the only explanation I can think of is that Sails loads controllers somehow weirdly. But I init supertokens before Sails so.... 🤷‍♂️
from experience I can tell that when something behaves "weirdly" the fault is somewhere in MY code haha 😄
but I can't figure this one out
r
hmm. The only explanantion is that the sails controller is happning before supertokens.init
so maybe find a place to run supertokens.init that runs before the controller
(i know i am stating the obvious, but im not familiar with sails)
c
Sails is quite bad, not a fan 😄 but yeah... it should do so already