Rank 2: Process
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
Votes
0
Replies
23
Participants
Unknown
Messages
24
Rank 2: Process
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
Rank 2: Process
can you send all the browser console logs?
Rank 2: Process
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
Rank 2: Process
@safwan again thnx bro lemme try it out
Rank 2: Process
@safwan javascript client.setEndpoint(process.env.END_PT).setProject(process.env.PROJECT_ID); this code is causing the above error
Rank 2: Process
@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?
Rank 2: Process
Nope
Rank 2: Process
Yes bro i didn't use double quotes
Rank 2: Process
@safwan lemme try that out bro
yep try rebuilding the app
Rank 2: Process
I did that for more than 3 times as of now ðŸ˜
Admin
you're using nextjs 13?
Rank 2: Process
@Steven yes
Admin
maybe try prefixing the env var with NEXT_PUBLIC_. See https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser
Rank 2: Process
@Steven okie
Rank 2: Process
@Steven it worked thank u
Admin
[SOLVED] CORS - request did not succeed
Admin
[SOLVED] CORS request did not succeed