Open t-lock opened 2 years ago
@t-lock Did you make any progress with this?
Adding this to polyfills/os.js
worked for me:
export function homedir() {
return '/';
}
Any other solution? I tried with polyfills/os.js but didn't work in my case
Hello,
Thanks for your work on this excellent and critical piece of OSS.
I am experiencing an issue trying to polyfill the node os module in a Vite build that bundles some pieces of the AWS javascript SDK v3 with my application. Specifically, AWS is trying to import
homeDir
from "os", which is a part of the node module here, but is not exported byrollup-plugin-node-polyfills/polyfills/os.js
As far as I can tell, it makes no sense to want a "homeDir" in the browser, so this may be an issue that should be raised with the AWS team. However, since it is an export on the node module, I think that some form of support, such as defaulting to the project root, or a configurable option to set the dist or public folder may be in order.
What do you think?