so i was getting this error this my website, so i setup an empty branch and started from scratch. I Installed "
git clone https://github.com/appwrite/starter-for-nextjs
cd starter-for-nextjs"
npm install
npm audit fix --force
npm run dev
appwrite sites create-deployment ^
--site-id ********************^
--code "." ^
--activate ^
--build-command "npm run build" ^
--install-command "npm install" ^
--output-directory "./.next"
changes in \src\lib\appwrite.js:
if (typeof window !== "undefined") {
client.setEndpoint("https://nyc.cloud.appwrite.io/v1");
}
if (process.env.NODE_ENV !== "production") {
client.setEndpoint("https://nyc.cloud.appwrite.io/v1");
}
.gitignore:
.git/
in the appwrite setting:
Build runtime: Node-18.0
and then it finally ran.