Skip to content

TS2339: Property '$supabase' does not exist on type 'x'. - nuxt-property-decorator #11

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jannikbuscha opened this issue Aug 26, 2021 · 4 comments · Fixed by #13
Closed
Labels
bug Something isn't working

Comments

@jannikbuscha
Copy link

Bug report - TS2339: Property '$supabase' does not exist on type 'x'. - nuxt-property-decorator

Description

Hello, I already reported this error on the last pull request, it's still the error I get when I use the whole thing with the functions from nuxt-property-decorator:

image

The funny thing is that everything works though:

image

Here the complete code:

image

Also added a ts-shim.d.ts and types

image

image

Are there perhaps other ways I can set this up?

System information

  • OS: Windows
  • Browser: Chromium
  • Version of supabase-js: ^2.0.0
  • Version of Node.js: v14.17.4.
  • Version of nuxt-property-decorator: ^2.9.1
  • IDE: PhpStorm 2021.2
@jannikbuscha jannikbuscha added the bug Something isn't working label Aug 26, 2021
@jannikbuscha
Copy link
Author

Bug report - TS2339: Property '$supabase' does not exist on type 'x'. - nuxt-property-decorator

Description

Hello, I already reported this error on the last pull request, it's still the error I get when I use the whole thing with the functions from nuxt-property-decorator:

image

The funny thing is that everything works though:

image

Here the complete code:

image

Also added a ts-shim.d.ts and types

image

image

Are there perhaps other ways I can set this up?

System information

  • OS: Windows
  • Browser: Chromium
  • Version of supabase-js: ^2.0.0
  • Version of Node.js: v14.17.4.
  • Version of nuxt-property-decorator: ^2.9.1
  • IDE: PhpStorm 2021.2

If i use the asyncData method as given in the example i also get this error:

image

@sduduzog
Copy link
Collaborator

sduduzog commented Sep 8, 2021

@scottrobertson I noticed that master is ahead of the latest release. The fix for this is actually there.

@jannikbuscha If you're still unsure about this, please install this module from github to try out the fix i.e. npm install supabase/nuxt-supabase and see that the typescript error message dissapears.

@scottrobertson This could be solved by a patch release I believe

@scottrobertson
Copy link
Contributor

@scottrobertson I noticed that master is ahead of the latest release. The fix for this is actually there.

@jannikbuscha If you're still unsure about this, please install this module from github to try out the fix i.e. npm install supabase/nuxt-supabase and see that the typescript error message dissapears.

@scottrobertson This could be solved by a patch release I believe

Hey

Sorry, out this week.

@kiwicopple could you perhaps make @sduduzog a contributor so they can do releases here and the other repo?

@sduduzog once you have access, just bump the version number in package.json and then go to the draft release in GitHub and publish it.

@sduduzog
Copy link
Collaborator

sduduzog commented Sep 8, 2021

It's worth mentioning @jannikbuscha

If you want to get this working in the meantime before the release, add this snippet to your projects types file

import { SupabaseClient } from '@supabase/supabase-js';

declare module 'vue/types/vue' {
interface Vue {
  $supabase: SupabaseClient;
}

or create a nuxt-supabase.d.ts file to the root of your project and add the snippet there i.e.
image

and this should get you sorted until it's part of the release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants