I tried to follow almost every tutorials available online to solve this error but those all didn't work along with it even javascript AppwriteException: Network request failed
even this error is printed in the console
can you send all the browser console logs?
AppwriteException: Network request failed
AppwriteException sdk.js:76
call sdk.js:398
rejected sdk.js:23
promise callback*step sdk.js:24
__awaiter sdk.js:25
__awaiter sdk.js:21
call sdk.js:335
create sdk.js:469
__awaiter sdk.js:25
__awaiter sdk.js:21
create sdk.js:444
signUpUser Signup.jsx:33
React 23
renderReactElement index.js:346
doRender index.js:489
_render index.js:507
asyncGeneratorStep _async_to_generator.js:13
_next _async_to_generator.js:31
_asyncToGenerator _async_to_generator.js:36
_asyncToGenerator _async_to_generator.js:28
_render index.js:525
render index.js:498
_hydrate index.js:639
asyncGeneratorStep _async_to_generator.js:13
_next _async_to_generator.js:31
promise callback*asyncGeneratorStep _async_to_generator.js:22
_next _async_to_generator.js:31
promise callback*asyncGeneratorStep _async_to_generator.js:22
_next _async_to_generator.js:31
promise callback*asyncGeneratorStep _async_to_generator.js:22
_next _async_to_generator.js:31
promise callback*asyncGeneratorStep _async_to_generator.js:22
_next _async_to_generator.js:31
_asyncToGenerator _async_to_generator.js:36
_asyncToGenerator _async_to_generator.js:28
_hydrate index.js:641
hydrate index.js:528
<anonymous> next-dev.js:40
promise callback* next-dev.js:35
NextJS 7```
@Berserker where is your client init?
you created an instance of Client
called client
, but you are not setting the endpoint, projectid
@safwan again thnx bro lemme try it out
@safwan javascript client.setEndpoint(process.env.END_PT).setProject(process.env.PROJECT_ID);
this code is causing the above error
@safwan whereas setting the endpoint and project id **as string ** directly , rather than importing them from the .env file is not causing any error
that seems like a problem with the ENV variables then.
Are you setting the ENV variables like so?
END_PT=https://your-domain.com/v1
Sometimes people store ENV variables in double quotes, which can be an issue
Another thing to check, is if you're rebuilding the app after adding the ENV variables?
Nope
Yes bro i didn't use double quotes
@safwan lemme try that out bro
yep try rebuilding the app
I did that for more than 3 times as of now π
you're using nextjs 13?
@Steven yes
maybe try prefixing the env var with NEXT_PUBLIC_
. See https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser
@Steven okie
@Steven it worked thank u
[SOLVED] CORS - request did not succeed
[SOLVED] CORS request did not succeed
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here π I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...