nuxt-supabase icon indicating copy to clipboard operation
nuxt-supabase copied to clipboard

TypeError: kit.addServerMiddleware is not a function.

Open kouwasi opened this issue 2 years ago • 10 comments

Bug report

TypeError: kit.addServerMiddleware is not a function

Describe the bug

Clould'nt start nuxt dev server.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create Nuxt 2 project with the nuxt-app with
? Programming language: TypeScript
? Package manager: Yarn
? UI framework: Vuetify.js
? Template engine: HTML
? Linting tools: ESLint, Prettier
? Testing framework: Jest
? Rendering mode: Single Page App
? Deployment target: Static (Static/Jamstack hosting)
? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript)
  1. Add this package to the project and add nuxt-supabase module to nuxt.config.js. image
  2. Run the yarn run dev
  3. See error

Expected behavior

I expected to run the nuxt server corectlly.

Screenshots

image

System information

  • OS: Ubuntu 20.04 LTS
  • Version of nuxt-supabase: ^2.3.1
  • Version of Node.js: v16.14.0

Additional context

I guess the problem happend from https://github.com/supabase-community/nuxt-supabase/blob/271db1b3216b7f1509ebd958553676f978bf0406/src/module.ts#L38-L41

kouwasi avatar Nov 11 '22 05:11 kouwasi

Oops. I was doing written to a wrong section buildModules. I moved to a right section modules, But it still not working.

image

kouwasi avatar Nov 11 '22 06:11 kouwasi

For nuxt2 try version 1.0.8 npm install [email protected]

andisulistyonugroho avatar Nov 16 '22 10:11 andisulistyonugroho

For nuxt2 try version 1.0.8 npm install [email protected]

This worked for me. Maybe docs just need to be updated?

syntheticgoo avatar Nov 29 '22 11:11 syntheticgoo

Maybe the supabase version needs to be pinned before work for the v2 client is published

sduduzog avatar Nov 29 '22 12:11 sduduzog

For nuxt2 try version 1.0.8 npm install [email protected]

This worked for me also. Thanks a lot.

mssrlefrancois avatar Dec 02 '22 20:12 mssrlefrancois

The version 1.0.8 is just injecting supabase client to Vue's DI container. Therefore this module is not needed IMO. And the @supabase/supabase-js as dependency is too old, about 2 years ago.

When guys want to use supabase client in Nuxt 2 without SSR, Just make a Nuxt plugin for provide supabase client. I think that correct way to use latest supabase client.

In this issue I'm talking about this bug. I mean SSR features of v2 in this module.

v1.0.8 DOES NOT HAVE IMPLEMENTED SSR FEATURES. LOOKS LIKE WORKING, BUT IT HAS NOT WORKS.

Please forcus to the described bug.

kouwasi avatar Dec 25 '22 16:12 kouwasi

I'll try to fix the bug myself to take more convenience.

kouwasi avatar Dec 25 '22 16:12 kouwasi

I am getting the same issue, does anyone fixed it?

tfiliano avatar Dec 28 '22 19:12 tfiliano

I got the same error. Does anyone managed to fix it ?

vincent2021 avatar Jul 14 '23 17:07 vincent2021

Switching to release 2.2.1 works fine on my side.

vincent2021 avatar Jul 14 '23 17:07 vincent2021