clerk / use-stripe-subscription

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

perkinsjr opened this issue · 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. 

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

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;

},
};

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