Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Appwrite CLI throws error when using Nuxt 3 #5685

Open
2 tasks done
davidschubert opened this issue Jun 10, 2023 · 6 comments
Open
2 tasks done

馃悰 Bug Report: Appwrite CLI throws error when using Nuxt 3 #5685

davidschubert opened this issue Jun 10, 2023 · 6 comments
Assignees
Labels
bug Something isn't working product / cloud Issues found only on Appwrite Cloud

Comments

@davidschubert
Copy link

馃憻 Reproduction steps

Environment
"nuxt": "^3.5.2"
"appwrite": "^11.0.0",

Can't really reproduction the problem. Because you can't install the Appwrite CLI on Stackblitz or Codesandbox.

Appwrite CLI:
https://appwrite.io/docs/command-line

and you need a simple appwrite account and project to init it.


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.

馃憤 Expected behavior

that everything works fine like before the "appwrite init project".

馃憥 Actual Behavior

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)

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

MacOS

馃П Your Environment

Local Environment
"nuxt": "^3.5.2"
"appwrite": "^11.0.0",

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@davidschubert davidschubert added the bug Something isn't working label Jun 10, 2023
@davidschubert
Copy link
Author

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);
});

@davidschubert
Copy link
Author

davidschubert commented Jun 10, 2023

Appwrite vite SSR import

I would guess that there might be an issue with ssr and appwrite. It would be worth investigating and updating the appwrite template, either way.

@davidschubert
Copy link
Author

davidschubert commented Jun 13, 2023

nuxt/nuxt#21510

@Haimantika
Copy link
Contributor

Thanks for raising this issue @davidschubert . @Meldiron is there a way to solve it?

@TorstenDittmann
Copy link
Contributor

How do you actually import the Client?

@joeyouss joeyouss changed the title 馃悰 Bug Report: 馃悰 Bug Report: Appwrite CLI throws error when using Nuxt 3 Jun 15, 2023
@joeyouss joeyouss added the product / cloud Issues found only on Appwrite Cloud label Jun 15, 2023
@joeyouss
Copy link

Hi @davidschubert, could you provide us with more information about this? Nonetheless, we are also having an internal discussion regarding this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / cloud Issues found only on Appwrite Cloud
Projects
None yet
Development

No branches or pull requests

4 participants