
This error occurs when attempting to use server actions in NextJS with appwrite.
First of all, all credit goes to @antho1404 (on Github). He identified that the issue is related to an import of the isomoprhic-form-data library overriding the FormData with an invalid object and further determined that it only happens when the library is imported rather than loaded over a cdn for example. The solution he came up with is to override the library with a dummy file.
One solution to fix this is to "override" this library with Webpack.
import weback from 'webpack'
const nextConfig = {
webpack(config) {
config.plugins.push(
new webpack.NormalModuleReplacementPlugin(
/^isomorphic-form-data$/,
${config.context}/form-data-mock.js
)
);
return config;
},
};
Then, create a form-data-mock.js in the root and the error goes away.
My question is: instead of this hacky approach, is there a way to fix this import in future versions, so that the community can take full advantage of server actions? With this error, server actions in NextJS are completely unuseable. All credit and enormous gratitude again to @antho1404 for diving into this.
Recommended threads
- Issue - Migration From Cloud > Self Host...
Hi team, I’m trying to migrate a few of my Appwrite projects from the cloud to a self-hosted instance. These projects are currently in “archive mode” due to th...
- Why "You’ve reached the limit for your G...
Why did Appwrite send me this alert when the usage reached 10605%? Is it too late? Why not when reached 100% usage? And I can not pay for more usage described ...
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
