Open daKmoR opened 1 year ago
I would really like to use supabase directly in the browser without any tools or build steps
I think this tutorial might help: Supabase - Back to the Basics(video).
It uses plain <script>
tags to load all supabase frontend libs, no build steps.
Reviving this one (Hi @daKmoR 👋🏼 ).
Fiddled around today with Supabase for the first time and noticed that it indeed isn't runnable natively in the browser. The packages I found were the culprit were the same ones as Dakmor has sited there.
I did some small adjustments to the @supabase/node-fetch and removed dependency on the websocket
package from @supabase/realtime-js and was able to get my browser client connecting to supabase without requiring a build step.
I'll be opening up a PR on both of the projects to start up some discussion and see if we could get these shipped so I could start using this tool
I've submitted 2 PR's to projects hosted by supabase. One is just a small code fix, the other one is a slightly larger fix with a dependency swap, but they both should function, and I've tested them locally on my supabase installation.
Would love if someone could take a look at them
This is now functional and shipped with the latest Supabase libs!
I've not tested around all of supabase packages, but it should work now
Bug report
Describe the bug
I wanted to give this a quick try and assumed that the es module version works in the browser
To Reproduce
index.html
fileExpected behavior
Logs createClient implementation
Actual behavior
Ideas
the above suggests that in the source code there are imports like
which is impossible to know for the browser what to load...
.js
?,.mjs
? ... also a browser cannot do da http request for each possibility to check what is available...e.g. we need to be more explicit... e.g. it should be
Follup up Issues
if the local import paths are solved a separate issue pops up
cross-fetch
sadly does offer an es module version... I opened an issueadditionally also
websocket
seems to not offer an es module version...so 2 dependencies we will need to "fix"
What do you think?
I would really like to use supabase directly in the browser without any tools or build steps 🤗 Also, I think with a few small changes and some updates/or different dependencies it should be possible to get this 🙏
If that is something you would like to support then I could certainly help make it happen 🤗
System information