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
Webpack 5 no longer provides polyfills for NodeJS packages. In my case I get Uncaught ReferenceError: process is not defined from this line. I.e., it's process.platform that fails.
I'm running an app built with Create React App, which is why I think the previous line referencing process.env seems to work.
The text was updated successfully, but these errors were encountered:
A simpler solution could be to just wrap the assignments of isWindows and isLinux in a try-catch, where you default to something sensible on error.
Though as I see it, I'm not sure querying process.platform and then hardcoding the behavior based on that is the best solution. For example, the reason I'm using ansi-colors in a web app is for communication with an external device via the Web Serial API. In that regard, process.platform is not useful at all, since it only applies to the host OS, not the one being communicated with. A solution where it's possible to configure the lib during runtime whether it should use Windows or Linux ANSI seems a lot more flexible to me.
Or, perhaps web and ANSI-colored text streams from external devices is not something you wish to support, which is fine too, and then I suppose you can leave it as is :)
Webpack 5 no longer provides polyfills for NodeJS packages. In my case I get
Uncaught ReferenceError: process is not defined
from this line. I.e., it'sprocess.platform
that fails.I'm running an app built with Create React App, which is why I think the previous line referencing
process.env
seems to work.The text was updated successfully, but these errors were encountered: