Closed xtj7 closed 1 year ago
Alright, I have figured it out, it seems the import path in the example is wrong:
Does NOT work:
import { ThirdPartyEmailPasswordPreBuiltUI } from 'supertokens-auth-react/lib/build/recipe/thirdpartyemailpassword/prebuiltui';
Works:
import { ThirdPartyEmailPasswordPreBuiltUI } from 'supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui';
Hey. Thanks for raising this issue. The docs does say:
import { ThirdPartyEmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui";
Am i missing something?
You are right! I copy and pasted that part, but for some reason my IDE (Goland) deemed it necessary to adjust the imports. I can't really reproduce that behavior unless I remove the import line and then autoimport it. In that case it will again jump to the wrong folder. Quite strange! So the error was not even in the docs, it was my IDE messing things up. Sorry for the incorrect information.
Apart from my IDE issue I have to say supertokens is a fantastic and properly documented solution that I'm loving so far :)
By following along the supertokens prebuilt guide (https://supertokens.com/docs/thirdpartyemailpassword/pre-built-ui/setup/frontend) in step 3 I unfortunately can't really make any progress using vite.
The import I am trying to make:
Results in this error:
If I remove the import, run vite and then add the import, it shows the following error:
It is properly installed in node_modules, my IDE can find it and autocomplete, but it seems vite just does not want to resolve that. It resolves everything else just fine, for example this is completely fine:
Dependencies are looking as follows:
My vite config looks like this:
I have tried it with @vitejs/plugin-react instead of @vitejs/plugin-react-swc as well with the same result. I am not quite sure why this particular issue happens. All the other imports work fine, this one does not.