I'm using webpack and babel to transpile my es6/jsx files in a node express React app I'm making. Everything is fine until I include the google spreadsheet
npm module and attempt to import it into my project.
I get the error Uncaught Error: define cannot be used indirect
but there is no define statement inside the imported module. This error only shows up in the browser, not in my console when webpack bundles my files, and completely stops anything from rendering on the page.
I think this is something to do with AMD/Commonjs but I am too inexperienced to know for sure, or what to even do if that were the case. Any help would be appreciated
Just a shot in the dark, but I ran into the same error with different library. It could be that google spreadsheet depends on json-schema too. Try putting this in your webpack config:
module: {
noParse: /node_modules\/json-schema\/lib\/validate\.js/, // <-- This
loaders: [
//all your loaders...
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With