Back

[SOLVED] Uncaught (in promise) Error: e._formData.get is not a function

  • 1
  • Web
xmaniaxz
8 Jan, 2024, 11:11

Hi, I seem to be running into an issue with my code here.

I have a database with 580 entries and i'm currently trying to list those entries. However when I try to make the call to the server. I get an error as shown in the title.

Tools: NextJS, Appwrite

TL;DR
User ran into an error "Uncaught (in promise) Error: e._formData.get is not a function" when trying to make a call to the server. The solution was to include Node-Appwrite in the next.config.js file. There was a similar issue found in Next.js repo related to an outdated version of Node.js causing the error. User confirmed that including Node-Appwrite resolved the issue.
Aditya Oberai
8 Jan, 2024, 11:49

@xmaniaxz I'm a little confused as to exactly which line you're getting this error on

Can you share the stack trace for this error please? That might help clarify exactly what is causing this error

xmaniaxz
8 Jan, 2024, 11:50

Ofcourse

xmaniaxz
8 Jan, 2024, 11:51
xmaniaxz
8 Jan, 2024, 11:52

Ive seen a similar ticket but that one never got resolved hence why i opened my own

Aditya Oberai
8 Jan, 2024, 12:00

@xmaniaxz are you sure this is the right client side code that you have shared?

Are you using any components here that contain a form?

xmaniaxz
8 Jan, 2024, 12:02

I am sure this is the correct code. the error start when i try to fetch my data from the database Line 44

im not using any other form

Aditya Oberai
8 Jan, 2024, 12:06

Okay

Aditya Oberai
8 Jan, 2024, 12:06

I'm investigating in the SDK

xmaniaxz
8 Jan, 2024, 12:08

thanks. If there is anything ya need.

Aditya Oberai
8 Jan, 2024, 12:09

@xmaniaxz what version of Node.js are you using?

xmaniaxz
8 Jan, 2024, 12:09

i believe its 14.0.4

xmaniaxz
8 Jan, 2024, 12:10

sorry its "node": "^21.2.0",

Aditya Oberai
8 Jan, 2024, 12:14

I have a found a similar issue in the Next.js repo where an outdated version of Node.js caused a similar error https://github.com/vercel/next.js/pull/57191

This does seem to be a Next.js/Node.js issue from what I understand

@Meldiron @Dennis Ivy have you come across this issue in the past?

xmaniaxz
8 Jan, 2024, 12:35

Ill take a look at it

xmaniaxz
8 Jan, 2024, 12:41

I have taken a look at this and it tells about node <= 18. I am on version 21

xmaniaxz
8 Jan, 2024, 15:30

Answer to my question:

This had to do with the fact that i did not have Node-Appwrite in my next.config.js file.

TypeScript
/** @type {import('next').NextConfig} */
const nextConfig = {
    experimental: {
      serverComponentsExternalPackages: ['node-appwrite'],
    },
  }
   
  module.exports = nextConfig
Aditya Oberai
9 Jan, 2024, 17:05

Ah alright! 😮 That's actually really good to know

@xmaniaxz did that solve your issue?

xmaniaxz
9 Jan, 2024, 17:07

It did yes!

Aditya Oberai
9 Jan, 2024, 17:24

Alright 👍

Aditya Oberai
9 Jan, 2024, 17:26

[SOLVED] Uncaught (in promise) Error: e._formData.get is not a function

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more