简体   繁体   中英

Bundling google-api-nodejs-client with browserify doesn't work

I'm trying to build a client-side application with google-api-nodejs-client using browserify. Looks like inside it is trying to read some mime-type info using fs module and fails to do it in browser.

    // Load additional types from node.js community
    mime.load(path.join(__dirname, 'types/node.types'));

    // Default type
    mime.default_type = mime.lookup('bin');

Did anybody use this API for client side development?

This question has been addressed and closed here on GitHub .

fs is not available from the browser, unfortunately. This library is specifically designed and implemented for server-side development and is unsupported for client-side development.

Check out https://developers.google.com/api-client-library/javascript/ which is designed for JavaScript client-application developers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM