
There is a bug in the combination of Nuxt 3 and Appwrite. If you start with a normal Nuxt 3 App and some Appwrite commands. Then everything works fine!
The bug starts when you start to use the Appwrite CLI and use the following command "appwrite init project" and init the project you are working on. After this, the app is not working anymore and gives me always an 500 error:
500
__vite_ssr_import_1__.Client is not a constructor
at _sfc_main.setup (./pages/health/index.js:81:23)
at callWithErrorHandling (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:156:18)
at setupStatefulComponent (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7190:25)
at setupComponent (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7151:36)
at renderComponentVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:614:15)
at renderVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:743:14)
at renderComponentSubTree (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:698:7)
at renderComponentVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:631:12)
at renderVNode (./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:743:14)

i found a solution. i need to put the new Client function in a onBeforeMount Lifecycle Hook. Does anybody has a answer why?
onBeforeMount(() => {
client.value = new Client();
client.value
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject("***");
account.value = new Account(client.value);
});

What's the import line say?

what do you mean bei "import line"?

Require/import for Client

import { Client, Databases, Functions } from "appwrite";

The Appwrite CLI part is really throwing me off...how is the Appwrite CLI related to your nuxt project? It's not in the package.json or bundled in your app is it?
Recommended threads
- line 1: 107 Killed npm run build
When trying to deploy my Nuxt app for testing, it goes through rendering chunks successfully and once it gets to Initializing the pre-renderer it throws this er...
- Vercel Deployment issue
I am trying to deploy my web project using vercel, but in the deployed link, it is fetching some of the attributes and for the rest it is giving "not found" err...
- Failing to run document operations on sd...
Could someone point me in the right direction I'm going in cirlces. I have a problem with sdks and my self-hosted server in production (for ~3 years) I have bee...
