Hello, Why can't I import the ui in react ``` import { getSuperTokensRoutesForReactRouterDom } from...
t
Hello, Why can't I import the ui in react
Copy code
import { getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react"
It tells me that it can't find a module with that name. Framework : React Vitejs Typescript Additional information: without vitejs, using create-react-app everything works perfectly.
r
hey @trovis_ the sdk you are using is the latest one. We will be updating our docs today to reflect the new API. Stay tuned.
t
@rp_st Thank you so much !
r
we just released the new docs. Empty cache and Hard reload the page. If it doesn't show the new import statement, change the
supertokens.com
domain to
test.supertokens.com
and see the content there 🙂
t
@rp_st I just tested with the new import: ``import { getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react/ui";`` and the problem persists. Error message in VSCode:
Copy code
Module '"supertokens-auth-react/ui"' has no exported member 'getSuperTokensRoutesForReactRouterDom'. Did you mean to use 'import getSuperTokensRoutesForReactRouterDom from "supertokens-auth-react/ui"' instead?
Additional information : I have the impression that probably Vitejs can't import some SuperToken module? Because I created a blank project with Vitejs and I still have the same problem.
r
Which version of the SDK are you using?
Maybe you can open an issue about this on our GitHub. We will check it out asap
t
Je suis désolé, c'est sûrement moi qui utilise mal SuperTokens, après avoir utiliser la nouvelle syntaxe d'import, cela marchait mais TypeScript m'affiche toujours la même erreur, j'ai pas réussi à l'enlever. Ce qui me pose aussi un problème maintenant, c'est de l'utilisation avec ``createBrowserRouter`` je n'arrive pas à le faire marcher. Je ne peut pas utiliser ``createBrowserRouter`` ? Doit-je obligatoirement utiliser la ```` comme dans la documentation? J'ai vu cette discussion, mais je ne sais pas comment l'implémenter https://stackoverflow.com/a/74510386
Update that work : My source : https://cloud.tencent.com/developer/ask/sof/107461868 On the other hand, why typescript does not find ``getSuperTokensRoutesForReactRouterDom`` and tell me:
Copy code
Module '"supertokens-auth-react/ui"' has no exported member 'getSuperTokensRoutesForReactRouterDom'. Did you mean to use 'import getSuperTokensRoutesForReactRouterDom from "supertokens-auth-react/ui"' instead?
r
which version of the supertokens-auth-react sdk are you using?
t
In my package.json ``"supertokens-auth-react": "^0.32.0"``
r
right. So the import should work..
try importing from
supertokens-auth-react/ui/index
?
t
Same error
Maybe it's my tsconfig? Or vite.config?
Yes when I added ``/ui`` It worked but I have a typescript error on my editor only, so I did a // @ts-ignore To ignore the typescript error I was just wondering why typescript fails to import properly
But on browser it works fine
r
im not sure. Does using tsc on CLI give the same error?
cause it might just be an editor issue and not actually a TS issue
t
I have the same error using tcs command
r
Oh! Oil you please open an issue about this?
On our GitHub
t
okey I'll do it
r
thanks
t
I just did it Thank for you, for listening
r
great! thanks for opening the issue. We will see what's happening
21 Views