Multiple emotion instances
Since supertokens-auth-react uses @emotion/react as a dependency causes the login/signup form from supertokens to not the get respected styles, if you're already using emotion in your project where you bring in supertokens.
This results in a warning about two instances of emotion:
You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.
This is quite annoying when you as a developer want to use emotion for your project.
I've tried to change to the exact same version to see if that would resolve it. It did not.
Oh! It didn't work even if you changed it to the exact same version. That's strange..
We depend on "@emotion/react": "^11.4.1". The latest version is 11.9.0. So supertokens-auth-react should pull in the latest version anyway. Perhaps try pruning the installed dependencies to remove duplicate "downloads" of the same version of a package (supertokens-auth-react might have installed it in /node_modules/supertokens-auth-react/node_modules and your installation might be in node_modules).
So removing the one from /node_modules/supertokens-auth-react/node_modules should work
I'll try :)
@rishabhpoddar Yep, removing emotion from /node_modules/supertokens-auth-react/node_modules did the trick for now.
Cool! I think we can consider getting rid of emotion from the library altogether. But that's probably not going to happen very soon. So keeping this issue open until then.
I am just going to use the 'patch-package' pkg for now. Not the best practice, but better than having to remove the node_modules each time
We have removed use of emotion in supertokens-auth-react version >= 0.30.0.