triniwiz / triniwiz/nativescript-plugins

nativescript-supabase return 'TypeError: Cannot read property 'decode' of undefined'

Open
#86 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
87
Forks
57
Avg merge
1h 36m
Merged PRs (30d)
4

Description

I've got error when try to fetch data from supabase.

package.json

"dependencies": {
    "@angular/animations": "~12.0.0",
    "@angular/common": "~12.0.0",
    "@angular/compiler": "~12.0.0",
    "@angular/core": "~12.0.0",
    "@angular/forms": "~12.0.0",
    "@angular/platform-browser": "~12.0.0",
    "@angular/platform-browser-dynamic": "~12.0.0",
    "@angular/router": "~12.0.0",
    "@nativescript/angular": "~12.0.0",
    "@nativescript/core": "~8.0.0",
    "@nativescript/theme": "~3.0.1",
    "@triniwiz/nativescript-supabase": "^0.1.0",
    "@triniwiz/nativescript-supabase-gotrue": "^0.1.0",
    "@triniwiz/nativescript-supabase-postgrest": "^0.1.0",
    "@triniwiz/nativescript-supabase-realtime": "^0.1.0",
    "@triniwiz/nativescript-supabase-storage": "^0.1.0",
    "rxjs": "^6.6.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~12.0.0",
    "@nativescript/android": "8.0.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "beta",
    "@ngtools/webpack": "~12.0.0",
    "typescript": "~4.2.0"
  },

Run on :
Angular CLI: 12.0.3
Node: 14.17.1
Package Manager: npm 6.14.13
OS: win32 x64

Angular: 12.0.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1200.3 (cli-only)
@angular-devkit/core 12.0.3 (cli-only)
@angular-devkit/schematics 12.0.3 (cli-only)
@ngtools/webpack 12.0.5
@schematics/angular 12.0.3 (cli-only)
rxjs 6.6.7
typescript 4.2.4


here is my code :

async ngOnInit(): Promise<void> {
  try {
      const supabase = createClient(environment.supabaseUrl, environment.supabaseKey, { detectSessionInUrl: false });
      const cars  = await supabase.from('cars').select().single();
  
      console.log('cars', cars);
  
  } catch(e: any) {
      console.log(e);
  } finally {
      console.log('finish');
  }
}

and here is console output :

JS: Angular is running in development mode. Call enableProdMode() to enable production mode.
JS: 1
JS: TypeError: Cannot read property 'decode' of undefined
JS: finish

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json and the ngOnInit example, then reproduce the fetch against the listed Angular, NativeScript, and Supabase package versions. Trace the createClient and supabase.from('cars').select().single() entry points to identify why the decode property is undefined; done means the fetch completes without this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
api, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.