Hey guys! I'm pretty sure I'm doing something stup...
# support-questions-legacy
a
Hey guys! I'm pretty sure I'm doing something stupid here But I'm getting a 404 when frontend is trying to reach the auth endpoint http://localhost:3000/auth/authorisationurl?thirdPartyId=google I have configured apiBasePath as
/auth
Anything I can check?
r
hey! can you enable backend debug logs and show me the output please?
a
Sure!
That's weird.. my logs are empty
r
hmm. even when you start the process?
a
Copy code
[nodemon] 2.0.19
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): server/**/*.* .env
[nodemon] watching extensions: js,json,mjs,yaml,yml
[nodemon] starting `babel-node server`
[1662912609174] INFO (backend/226452 on host): up and running in development @: host on port: 3000}
This is all I have..
r
are you calling supertokens.init?
a
I am! And when I had put it in the wrong place, it was letting me know that I haven't initialised
r
hmm. Can you console log right before you call the init function? Also, how have you enabled debug logs?
a
Please give me half an hour, if that's cool. Something something has come up. I will figure out the logs and get back to you
r
cool
a
Hey!
Copy code
[1662914400716] DEBUG (voluntable-backend/237222 on Monaa): Initializing Supertokens!
[1662914400742] DEBUG (voluntable-backend/237222 on Monaa): Adding middleware!
Adding middleware!
[1662914400757] INFO (voluntable-backend/237222 on Monaa): up and running in development @: Monaa on port: 3000}
[1662914414456] WARN (voluntable-backend/237222 on Monaa): request completed
    req: {
      "id": 1,
      "method": "GET",
      "url": "/auth/authorisationurl?thirdPartyId=google",
      "query": {
        "thirdPartyId": "google"
      },
      "params": {},
      "headers": {
      ...  
      "cookie": "username-localhost-8888=\"2|1:0|10:1662875121|23:username-localhost-8888|44:NDhjYjQ1ODNhNjc3NDIzMzgwOWIyYzRhOWM2OGFlM2U=|b3ad763b5a4efc80caec0cd82351e7b82c219e3281d7063567d08130175fe262\"; _xsrf=2|8030b268|1515fa3c42c49a0fbd5e1ca8a8e34ccc|1662843712; sIRTFrontend=remove",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-site",
        "pragma": "no-cache",
        "cache-control": "no-cache"
      },
      "remoteAddress": "::ffff:127.0.0.1",
      "remotePort": 44146
    }
    res: {
      "statusCode": 404,
      "headers": {
        "x-powered-by": "Express",
        "access-control-allow-origin": "http://localhost:4200",
        "vary": "Origin",
        "access-control-allow-credentials": "true",
        "content-security-policy": "default-src 'none'",
        "x-content-type-options": "nosniff",
        "content-type": "text/html; charset=utf-8",
        "content-length": 160
      }
    }
    responseTime: 45
This is what I have I've truncated some of the log because discord limit
r
hey! this isn't the debug logs we generate
how have you enabled debug logging?
a
Oh.. supertokens module has debugging built in? My bad. Give me a second
r
yea
you should checkout the troubleshooting section
it shows you how to enable backend debug logs
a
Found it
Is there a better way to share logs?
Discord has this character limit thing
r
i think you can upload as a file
a
r
right, and when you send the request, it should generate more logs
a
r
so the issue is that you have initialised different recipes on the frontend and backend
backend you have done thirdpartyemailpassword
frontend is just thirdparty
so change one of them so that they both match
a
Ah shucks
r
and then it should work
a
Yep. I was doing a stupid thing. Thank you so much! I wasn't aware of the debug thing
r
fair enough 🙂
happy that this helps!
a
Helps a lot!
One more thing, is there a way to debug the frontend as well?
r
yea.. same page shows you how to do that
a
I'm seeing that the ui is not styled. But no errors in the console.. So I'm a bit lost
r
hmm. This usually happens cause you are using emotion lib
with a different version than what we are using
or you may be using a UI lib that depends on emotion
or has a peer dependency on emotion
a
Yeah. That's it.. I found @emotion in the dep tree
r
right
so just make sure to use the same version as what we use
a
Got it!
"^11.1.0"
and
^11.10.0
shouldn't make too much difference
Although.. I think.. keeping track of which dependency has emotion as a peer is going to be a hassle I'll try to inject a custom style and leave it at that
hopefully that works
r
cool!