Brilynd
Brilynd5mo ago

Unable to locate "@convex-dev/auth/providers/Password" in react native

I currently was following the Password Auth tutorial for react native and the only file in "@convex-dev/auth/providers" is a package.json file. How can I add the Password file to it? I already followed the initial setup tutorial and installed all the stated dependencies.
6 Replies
sshader
sshader5mo ago
Are you having issues with your bundler or at runtime with the import? Could you share the error you're hitting?
Danny I
Danny I4mo ago
Static Rendering Error (Node.js)
While trying to resolve module `@convex-dev/auth/providers/Password` from file `/Users/daniel/Documents/Projects/chat-plan-ai/convex/auth.ts`, the package `/Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/providers/Password/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js`. Indeed, none of these files exist:

* /Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
* /Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js/index(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
Source

1 |import { Password } from "@convex-dev/auth/providers/Password";
Static Rendering Error (Node.js)
While trying to resolve module `@convex-dev/auth/providers/Password` from file `/Users/daniel/Documents/Projects/chat-plan-ai/convex/auth.ts`, the package `/Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/providers/Password/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js`. Indeed, none of these files exist:

* /Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
* /Users/daniel/Documents/Projects/chat-plan-ai/node_modules/@convex-dev/auth/dist/providers/Password/index.js/index(.web.ts|.ts|.web.tsx|.tsx|.web.js|.js|.web.jsx|.jsx|.web.json|.json|.web.cjs|.cjs|.web.mjs|.mjs|.web.scss|.scss|.web.sass|.sass|.web.css|.css)
Source

1 |import { Password } from "@convex-dev/auth/providers/Password";
It just happened suddenly... I must have done something 🤔
Danny I
Danny I4mo ago
No description
sshader
sshader4mo ago
I'm not sure what's causing your issue, but sharing https://github.com/get-convex/expo-convex-auth which is an example app of Expo + Convex Auth (including the Password provider). Perhaps comparing them will help -- also curious if you get the same build error with that demo app
GitHub
GitHub - get-convex/expo-convex-auth: Example app of Expo + Convex ...
Example app of Expo + Convex Auth. Contribute to get-convex/expo-convex-auth development by creating an account on GitHub.
Danny I
Danny I4mo ago
It works in the demo app, and the package is the same, so I must have changed something (it used to work).
No description
Danny I
Danny I4mo ago
Found it. I was messing around with type completion trying to find a user/auth hook, I had this import in a component:
import { auth } from '@/convex/auth';
import { auth } from '@/convex/auth';
and I had it invoked on a line:
auth;
auth;
That caused the error. 😮‍💨 Thanks for your reply 🙇🏻‍♂️

Did you find this page helpful?