adrianhajdin / healthcare

Build a healthcare platform that streamlines patient registration, appointment scheduling, and medical records, and learn to implement complex forms and SMS notifications.
https://jsmastery.pro
1.81k stars 432 forks source link

An error occurred while retrieving the patient details: SyntaxError: "undefined" is not valid #21

Open shefin-xyz opened 2 months ago

shefin-xyz commented 2 months ago

An error occurred while retrieving the patient details: SyntaxError: "undefined" is not valid JSON at JSON.parse () at i (/var/task/.next/server/chunks/30.js:1:19308) at b (/var/task/.next/server/app/patients/[userId]/register/page.js:1:46676) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /var/task/.next/server/app/patients/[userId]/register/page.js:1:3374

junior8adlt commented 1 month ago

An error occurred while retrieving the patient details: SyntaxError: "undefined" is not valid JSON at JSON.parse () at i (/var/task/.next/server/chunks/30.js:1:19308) at b (/var/task/.next/server/app/patients/[userId]/register/page.js:1:46676) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /var/task/.next/server/app/patients/[userId]/register/page.js:1:3374

I was experiencing the same issue. I searched through many forums and read more information in the documentation, but I couldn't find the solution until I realized that the node-appwrite package is constantly being updated. I was using version 13.0.0, which basically broke the Query function and returned nothing. What I did was install version 12.0.1, and that fixed the problem. Note that when you downgrade to this version, the import { InputFile } from 'node-appwrite/file' changes to just

import { InputFile } from 'node-appwrite';

and you will need to change fromBuffer to fromBlob.

This solved the issue.

Babylon-Lion commented 1 month ago

This didn't help, the error appeared initially with version 12.0.1, I upgraded to 13.0.0 and changed the import to import { InputFile } from 'node-appwrite/file and the fromBlob and I still seem to be stuck at this stage

GrowWidTalha commented 1 month ago

I have the same error but with the first user that i created it works fine but when I try creating appointment with second user it break and gives me this error

GrowWidTalha commented 1 month ago

@junior8adlt thanks for the solution it worked

shashi4263 commented 1 month ago

@junior8adlt Thank you very much it worked for me. Thank you.......