nodecraft / b2-cloud-storage

Backblaze B2 Cloud Storage API Client. Implements all of the B2 Cloud Storage APIs, with helper methods for uploading files.
MIT License
42 stars 10 forks source link

TypeError: url.URL is not a constructor #34

Closed shen-yu closed 4 years ago

shen-yu commented 4 years ago

Hello, i'm using b2-cloud-storage npm package in my react-website,and run code like your Basic Example,but it's not work. how can i resolve this ? Thanks !

image

image

Cherry commented 4 years ago

This library is currently only designed to work in a Node environment - not in the browser.

With a build chain you may be able to polyfill used Node libraries, but this makes heavy use of fs, as well as other node builtins like os and the mentioned url.

shen-yu commented 4 years ago

@Cherry yes, i'v wrote a web version: B2Viewer, It still has a lot of imperfections, such as Upload files and folder, you are right, it should make heavy use of fs and other node modules.