npx convex dev error
getting error in this format
this is my first time using convex, i have looked other related post, but could nt be able to fix it, can you tell me where should i made the changes required ?
project link - https://github.com/azr-arch/unishare
--verbose logs:
GitHub
GitHub - azr-arch/unishare: UniShare is a platform that allows user...
UniShare is a platform that allows users to upload, host, and share documents, images, and videos. It's perfect for anyone who wants to share files quickly and easily online. - azr-arch/unishare
10 Replies
@azar it sounds like you're trying to use a Node.js builtin (
fs
) which doesn't work in convex queries and mutations. See https://docs.convex.dev/functions/runtimesRuntimes | Convex Developer Hub
Convex functions can run in two runtimes:
i dont know where i am using it, can you take a look at provided repo, and tell me where the fix is required?
Your error message says that next is using it, not sure what next functionality might be at play here. You could use the node runtime for whatever next functionality is being used and see if it works there.
tried using "use node" on top of every file in convex, still it dont work
Oh I just meant whatever file is importing from the next package, but it would have to not contain any queries or mutations
Using node for all convex files will break any file that contains queries or mutations, and probably some others.
Taking a look at your repo
You have an auth.ts in your convex folder that is likely causing it, and I don’t believe you need it
Your code is being indexed on GitHub so I can’t search it right now (on mobile) - where are you using the
generateAuthToken()
function from that file?did you mean
getAuthToken
? in auth.ts
looks like it isnt being used anywhereRight but is your convex/auth.ts file being imported anywhere
i dont think so
wait i am trying to run the convex server without auth file
it worked!
thanks man
No problem!
👍