node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

webpack: unable to compile

Open rrrepos opened this issue 3 years ago • 0 comments

I am able to successfully use the library under the NodeJS environment and works very well. But I do have a use-case where I would like pure-browser access to google sheets without using gapi auth but the service-account auth like you recommend in NodeJS

However, when I try to compile using webpack, I get a series of errors staring with

Module not found: Error: Can't resolve 'buffer' in {path}/node_modules/buffer-equal-constant-time'

The source js is

//index.js in src
const { GoogleSpreadsheet } = require('google-spreadsheet');

I even tried with import

import GoogleSpreadsheet  from 'google-spreadsheet';

I am aware of the security limitations of my approach but I wonder why webpack is throwing errors. Thanks

rrrepos avatar Jan 27 '21 05:01 rrrepos