Open davidcastagnetoa opened 1 year ago
@davidcastagnetoa I got the same error and couldn't find the problem. I replaced my code with the repos code and refreshed the app. It started working. Try the same solution hope it works!
@ALIRAZA17 Finnally I resolved the problem, in my case I have an syntaxis error in Form.jsx, line 25
<textarea value={post.promt} onChange={(event) => setPost({ ...post, prompt: event.target.value }) } placeholder="Your AI Prompts Here!" className="form_textarea" />
Instead post.prompt, I use post.promt. I advice you to review the Form.jsx and looking for syntaxis errors, try to use ESLint in order to find more errors like this
Good Luck, Happy hacking!
POST http://localhost:3000/api/prompt/new 500 (Internal Server Error) page.jsx:22
`try { const response = await fetch("/api/prompt/new", { method: "POST", body: JSON.stringify({ prompt: post.prompt, userId: session?.user.id, tag: post.tag, }), });
};`
I dont have idea Why