Replies: 6 comments 12 replies
-
Is it a package from Google that you are unable to use inside workers? If so, which package? Does google offer a web API of some sort that you could just post data to? |
Beta Was this translation helpful? Give feedback.
-
Yep, here the code that I would use in a normal NodeJs environment:
There is a way to do it without the library, but it's not trivial and I wasn't able to make it work so far :(. |
Beta Was this translation helpful? Give feedback.
-
I'm using Shopify Hydrogen for hosting. The snippet above is what I developed in Nextjs to get the same result. But whenever I try to import some similar library, I get an error. The specific error:
|
Beta Was this translation helpful? Give feedback.
-
@blittle, you're right. It's a limitatiom from Oxygen, not Hydrogen. PS: Not fly.io or Vercel seems to be supporting the hello word template from Hydrogen out of the box. I tested both and also tried to follow the recommendations from the docs (remove For now I'm just using I tried 1. but it's much more complicated and not well documented as well and more complicated to maintain. 2 I didn't find a good polyfill in a quick search. I'm open to suggestions. If anyone else is facing a similar problem I recommended using firebase functions or aws lambda. Would be nice if the official template generated by |
Beta Was this translation helpful? Give feedback.
-
I haven't read all the posts, but Oxygen should NOT be responsible for uploading your files. WhyYou should use "fetch" in your components, not in your loader or action. You must upload the file directly from the user browser to Google Cloud, or whatever service you're using. I'm using Shopify's FileCreate to upload my files to Shopify. People often forget that Shopify won't allow wastage of resources. There are millions of people using Shopify, and they aim to minimize a lot of server handling tasks. Steps
I hope it make sense. HowI'm pretty sure whatever service you are using, can provide you with the url to DIRECTLY upload the file to them in the browser without interaction with your servers. [YES] USER <> GOOGLE |
Beta Was this translation helpful? Give feedback.
-
@jamalsoueidan, I'm not uploading the file on Oxygen. I generate an url to upload to Google Storage and the user uploads to the storage directly. I just need oxygen backend to be able to generate the signed Url for this :). |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm having lots of problems to be able to upload a file using Google Storage inside Hydrogen since its workers doesn't support the official google library.
My store has a few features powered by Google AI. So I do need to store a few things there to be able to use their AI APIs properly.
I'm wondering if anyone has some working code for Hydrogen to be able to upload it to Google Storage. It can be inside the backend or in the frontend using signed Urls.
Beta Was this translation helpful? Give feedback.
All reactions