Giter VIP home page Giter VIP logo

Comments (21)

kiwicopple avatar kiwicopple commented on May 12, 2024 3

🎉 This issue has been resolved in version 1.3.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

from supabase-js.

malobre avatar malobre commented on May 12, 2024 3

Updating to 1.3.2 did fix the problem for me.

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024 1

🎉 This issue has been resolved in version 1.1.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

from supabase-js.

jhoch avatar jhoch commented on May 12, 2024 1

For another data point, I was running into a similar issue, and applied the fix you put up in supabase/auth-js#42 locally, and it resolved the issue.

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024 1

thanks for the patience everyone! We're super busy, so a bit slow getting to some of these items. I'll close this, and feel free to reopen if you have any issues

And thanks for checking out Supabase ⚡

from supabase-js.

emschwartz avatar emschwartz commented on May 12, 2024

I think this may have been fixed by supabase/auth-js#37 What version of gotrue-js is it pulling in?

from supabase-js.

Penkie avatar Penkie commented on May 12, 2024

I updated supabase-js to 1.1.4 and checked that gotrue-js is 1.9.3 (wich is the case) and I'm still having this issue

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024

OK thanks for the update @Penkie . Reopening to investigate ..

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024
  1. Create Angular project
  2. Create angular service

Could you please set this up on codesandbox or give some instructions? I've never used angular, this would probably take me an hour to figure out. Even better if you can start ad branch with anangular-todo-list in our examples. That would be massively helpful for the community (but not necessary, I just need a way to debug this)

from supabase-js.

Penkie avatar Penkie commented on May 12, 2024

I tried with stackblitz, no problem I didn't have any errors. Tried also on codesandbox, loads of problems, maybe the dependencies not working. Anyway I created a repo with the Angular project inside : https://github.com/Penkie/supabase-js-debug-angular
You can check there
Note that I did not create any service (like I mentionned up there that you have to, but actually no you don't), so everything is on app.component.ts

from supabase-js.

laurentS avatar laurentS commented on May 12, 2024

For what it's worth, I'm having the same issue in a svelte/sapper app. For now, I'm bypassing the error with window.process = window.process || null in the page's script. It's not exactly ideal, but for now I can move on :)

I've setup a basic repro repo at https://github.com/laurentS/supabase-bug-repro-113
to reproduce:

  • clone the repo
  • yarn install
  • yarn run dev
  • open the landing page (should be http://localhost:3000) and watch the error message appear after a few milliseconds

All it takes is importing the supabase client (see the last commit in the main branch).
Hope this helps!

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

Looks like gotrue-js is using process.env, which makes it non-isomorphic. supabase/auth-js#37 moves the problem to the bundler (Rollup) instead, which wasn't able to match-replace process.env. So if you add "process": undefined in the Rollup replace plugin in laurentS's example above, the app works.

Can we maybe refactor gotrue-js to use e.g. default parameters when initializing the client instead?

from supabase-js.

inian avatar inian commented on May 12, 2024

Error report from @thorwebdev
our unpkg build (https://unpkg.com/@supabase/[email protected]/dist/umd/supabase.js) is erroring
image

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024

Hey @soedirgo - just checking on this commit

particularly these lines:

    new webpack.DefinePlugin({
      'process.env.GOTRUE_URL': undefined,
      'process.env.AUDIENCE': undefined,
      'process.env.EXPIRY_MARGIN': undefined,
      'process.env.STORAGE_KEY': undefined,
    }),

Is there a webpack plugin that can fix this issue for browser builds? Maybe this?

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

Huh, I don't remember adding those... let me try that.

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

Hey @Penkie, can you update the supabase-js client and see if it works now? I tried @laurentS's Sapper app with the update and saw no issue.

Edit: my bad, it's still not working. Give me a moment.

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

So using the Webpack plugin above wouldn't fix it, because it only affects the browser build that's in dist/umd. So the change needs to be in the user's bundler config.

@kiwicopple is there a specific reason to use process.env in gotrue-js? Looks like it's only used as default options for the client. Otherwise I can make a quick PR to fix this.

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024

is there a specific reason to use process.env in gotrue-js

That was just as a convenience, but looks like it's problematic. How are these usually handled in isomorphic libs? Using dotenv?

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

I don't think libraries in general use process.env, only apps. Maybe it's possible to use Webpack for all 3 builds, but that's an antipattern (bundling should be done by end-user apps, not libraries), and more trouble than it's worth, IMO.

from supabase-js.

kiwicopple avatar kiwicopple commented on May 12, 2024

OK , just pushing the new version - I'll keep it open this time until we've confirmed that it's resolved

from supabase-js.

soedirgo avatar soedirgo commented on May 12, 2024

Should be working now, when trying laurentS's example above make sure to yarn upgrade first. Let us know if it works for y'all!

from supabase-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.