Hey there supertokens community 👋 I stumbled upon supertokens and am pretty excited to use it in a...
d

deezy5456

almost 3 years ago
Hey there supertokens community 👋 I stumbled upon supertokens and am pretty excited to use it in a side project of mine! TL;DR:
getRoutingComponent()
does not render in chrome extension, but does when run via
npm start
or
npm run build && serve -s {{path}}
My current project involves a chrome extension running a react app in its popup. It is in this react app that I would like users to register or login using supertokens. To this end, I followed your getting started guide. As a minimal example, I simply initialize
SuperTokens
and call
getRoutingComponent()
, which IIUC, returns an element that renders the login/registration UI. That being said, when I use
npm start
or
npm run build && serve -s {{path}},
I do see the login UI being rendered. When turning on debug logs and logging the return value of
getRoutingComponent()
, I do see
SuperTokens
being initialized as well as the return value of the function call not being
null
. Instead, I can see it is of type
react.element
with a props
path
of
index.html
and
supertokensInstance
being the supertokens instance. This led me to the conclusion that soemthing's wrong with my configuration since it's working with both the devserver and as a production build being served. I've searched for similar use cases and indeed found some who were using supertokens in a chrome extension but nothing comparable here