You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Isn't webpack supposed to be able to provide a web-equivalent?
Pretty difficult to spawn a process and access the filesystem in the web... So there is no replacement for these modules. Propably means you can't use this module in a browser...
yes you can do that and hope that the module doesn't use any of the methods from this modules.
The proper course is the ask the module author to make the module browser compatible. The author can add browser: { fs: false, child_process: false } to the package.json to tell webpack that it's ok for the module to get an empty object for these modules.
Is it possible to add this to the official documentation (i.e. "How to handle 3rd-party libraries with unresolved dependencies")? Otherwise, I assume other users will open issues asking the same question for different libraries.
Hey! So, I just wanted to point out that the stripe Node module is only meant to be used server-side, as it requires using a secret key that should never be shared into the wild (on the web).
If you're looking to capture card details and other things from customers, Stripe.js can help you do that.
Activity
pksjce commentedon Sep 7, 2016
From @sokra on January 31, 2015 15:56
Pretty difficult to spawn a process and access the filesystem in the web... So there is no replacement for these modules. Propably means you can't use this module in a browser...
pksjce commentedon Sep 7, 2016
From @cowwoc on January 31, 2015 16:7
What is the proper course of action?
I read elsewhere that I can do this:
but is there a better approach (keeping in mind that I can't modify the 3rd-party library)?
pksjce commentedon Sep 7, 2016
From @sokra on January 31, 2015 16:11
yes you can do that and hope that the module doesn't use any of the methods from this modules.
The proper course is the ask the module author to make the module browser compatible. The author can add
browser: { fs: false, child_process: false }to thepackage.jsonto tell webpack that it's ok for the module to get an empty object for these modules.pksjce commentedon Sep 7, 2016
From @cowwoc on January 31, 2015 16:54
Sounds good.
Is it possible to add this to the official documentation (i.e. "How to handle 3rd-party libraries with unresolved dependencies")? Otherwise, I assume other users will open issues asking the same question for different libraries.
pksjce commentedon Sep 7, 2016
From @sheerun on November 26, 2015 13:58
If you build for electron, you can add child_process to external modules
floatingLomas commentedon Sep 13, 2016
Hey! So, I just wanted to point out that the
stripeNode module is only meant to be used server-side, as it requires using a secret key that should never be shared into the wild (on the web).If you're looking to capture card details and other things from customers, Stripe.js can help you do that.
SpaceK33z commentedon Oct 3, 2016
Closing this, what @floatingLomas said is right. You can't use a server side module on the web, and I don't think we can document this any clearer.
Merge pull request webpack#107 from dear-lizhihua/cn
TomHarker commentedon Mar 30, 2017
How are you supposed to know if a node module is browser compatible? And why should webpack care? I'm trying to build for NW.js
fabiooshiro commentedon Aug 5, 2017
@TomHarker
I'm trying to build for electron.
electron workaround
webpack.config.js
index.html
my_program.js