use-stripe-subscription icon indicating copy to clipboard operation
use-stripe-subscription copied to clipboard

Warning presented when using use-stripe-sunscription `can't resolve child_process`

Open perkinsjr opened this issue 3 years ago • 3 comments

When using use-stripe-subscription you get the following

Module not found: Can't resolve 'child_process' in '/Users/ndimatteo/code/projects/ntl/node_modules/use-stripe-subscription/node_modules/stripe/lib'```

It doesn't cause functionality issues but we should investigate how to remove this. 

perkinsjr avatar Aug 10 '22 15:08 perkinsjr

Anyone figure this out? Doesn't seem to break anything but don't want to go into production before resolving.

gannonh avatar Mar 11 '23 01:03 gannonh

Ok, I figured it out. Need to do some webpack config. I'm using nextjs so added the webpack entry to next.config.js

/** @type {import('next').NextConfig} */ module.exports = { reactStrictMode: true, images: { domains: ["upcdn.io", "replicate.delivery"], }, webpack: (config, { isServer }) => { if (!isServer) { config.resolve.fallback.fs = false; config.resolve.fallback.tls = false; config.resolve.fallback.net = false; config.resolve.fallback.child_process = false; }

return config;

}, };

gannonh avatar Mar 11 '23 01:03 gannonh

this won't be real functionality. we haven't looked at this recently as we are working on core product but the project should be fine for production and has been tested in deployments

perkinsjr avatar Mar 11 '23 01:03 perkinsjr