Skip to content
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

storage client library compatible with create-react-app #2226

Closed
daniel-odc opened this issue Jun 27, 2023 · 4 comments
Closed

storage client library compatible with create-react-app #2226

daniel-odc opened this issue Jun 27, 2023 · 4 comments
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web

Comments

@daniel-odc
Copy link

Hello
many thanks for your great client libraries. The documentation is great and the code samples very clear.
My issue is that I am developping React applications using create-react-app and it seems that it is incompatible with some of your methods.

Example: I am using the uploadFile.js code sample, which creates the following error:

Uncaught (in promise) TypeError: fs.createReadStream is not a function

I gather this is because these libraries are designed to work with node.js in the backend. Would it be possible to make them compatible with front-end React code?
Many thanks

@daniel-odc daniel-odc added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jun 27, 2023
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Jun 27, 2023
@ddelgrosso1
Copy link
Contributor

ddelgrosso1 commented Jun 27, 2023

Hi @daniel-odc thanks for the question. We get this question / request fairly regularly (ex: #1883). As you noted this library was originally written for Node and we currently don't support browser based usages.

Due to the frequency of this question and the large community of web developers we are actively investigating how we can bring support to the browser. No timelines have been established but it is definitely on our radar.

If you have a server side API written in Node I can offer a workaround for uploading a file by generating a signed URL on the server side, returning it to the client side, and using the HTTP lib of your choice to perform the upload.

@ddelgrosso1 ddelgrosso1 self-assigned this Jun 27, 2023
@ddelgrosso1 ddelgrosso1 removed the priority: p3 Desirable enhancement or fix. May not be included in next release. label Jun 27, 2023
@daniel-odc
Copy link
Author

daniel-odc commented Jun 28, 2023 via email

@ddelgrosso1
Copy link
Contributor

@daniel-odc I am going to close this issue to help keep things organized. Please feel free to follow / add comments to #1883.

@daniel-odc
Copy link
Author

daniel-odc commented Jun 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. web
Projects
None yet
Development

No branches or pull requests

2 participants