Error TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at Account.create (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/services/account.mjs:71:17)
at $$ACTION_1 (webpack-internal:///(action-browser)/./lib/actions/user.actions.ts:36:46)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_URL',
input: 'undefined/account'
}
This error is showing in my terminal and I am unable to fix it
I am trying to connect to the database using appwrite on my next.js application
Error TypeError: Invalid URL
at new URL (node:internal/url:796:36)
at Account.create (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/services/account.mjs:71:17)
at $$ACTION_1 (webpack-internal:///(action-browser)/./lib/actions/user.actions.ts:36:46)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_INVALID_URL',
input: 'undefined/account'
}
This error is showing in my terminal and I am unable to fix it
I am trying to connect to the database using appwrite on my next.js application
Share Improve this question edited Feb 17 at 16:40 Mureinik 312k54 gold badges353 silver badges389 bronze badges asked Feb 17 at 15:51 Rishabh RajRishabh Raj 1 New contributor Rishabh Raj is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 2 |1 Answer
Reset to default 1It looks like your Appwrite endpoint or project ID is either missing or incorrectly configured, which is causing an invalid URL (undefined/account).
Check Your Environment Variables Make sure your .env.local file has the correct Appwrite credentials:
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT=your_project_id
NEXT_PUBLIC_APPWRITE_DATABASE_ID=your_database_id
NEXT_PUBLIC_APPWRITE_COLLECTION_ID=your_collection_id
please share the code you write without your credentials so we can help you if it still exists
Appwrite
to connect to the database (especially the code aroundAccount.create
and the URL you're using). – evolutionxbox Commented Feb 17 at 15:53