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

Bundling with Webpack #72

Open
mikinty opened this issue Jul 23, 2020 · 0 comments
Open

Bundling with Webpack #72

mikinty opened this issue Jul 23, 2020 · 0 comments

Comments

@mikinty
Copy link

mikinty commented Jul 23, 2020

If anyone is trying to use this package with webpack, you might get some errors like

ERROR in ./node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '...\node_modules\request\lib'

I think the error has to do with something Node specific and browsers not supporting Node's full capabilities.

A fix I found was to add the following to your webpack.config.js:

module.exports = {
  node: {
    fs: 'empty',
    net: 'empty',
    tls: 'empty'
  }
}

I'm actually not exactly sure what this does, but I'm assuming it just removes the need for these packages in the final bundle.

Unsure if this is the proper way to go about bundling this package in browser apps.

I still run into #34 CORS issues after getting this bundle to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant