-
Notifications
You must be signed in to change notification settings - Fork 73
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
Update fetchAdapter.js to use globalThis instead of global. #428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, I run into this as well
globalThis is not supported by IE and some old versions of browsers as well as nodejs lower 12.0.0 that we still support. |
@fireridlle as far as my limited knowledge goes; this currently doesn't work in any browser. At least that is what my SSR setup is telling me. Do you have another recommendation to enable the driver to work in browsers? |
I think it doesn't work at SSR for some reason. I have just tested on react create app and vuex and wasn't able to reproduce. |
@fireridlle Using an empty project I am unable to reproduce it. I was using Svelte/Sapper. I moved over to using it again in my project and it appears to be working fine now. If it happens again I will get a project together; but my feeling is that something was wonky when I put this up and now it seems that everything is happy. Okay to close this for now and I will re-open if it burps again? |
@entioentio You have this issue also? Any chance for a reproduce? |
@twobitunicorn this is not much more than a reproduction case https://github.com/entioentio/toodoo. Repo made for playing with faunaDB addon to netlify and that all with vite + vue. Weird as it is, it happens only with |
@entioentio Thanks. I was also able to reproduce it here: https://github.com/twobitunicorn/globalThis |
@entioentio thank you for the repository. I was able to run
|
@twobitunicorn thank you for the repository. I was able to reproduce the issue with After fixing this, I have got |
@fireridlle I've just realized that I have pushed my silly workaround for the time being (I'm not even sure why the heck should it work 🤷♂️ I've fresh installed it and still get the error. I hate to ask you this since you've already spent much time om this, but could please check to reproduce this withouth this line? It's already gone from the repo. |
With removing BTW, we are working to provide both CJS and ES5 modules systems. The release date is not clear yet. FYI, I found another issue with vitejs, the doesn't respect |
@fireridlle Rad. Thanks! |
Notes
Sorry. no Jira ticket.
How to test
I had a situation where I needed faunadb to run in an SSR environment on top of Vite. global was not found so I changed it to globalThis which handled the clientside compile for me.
Screenshots