emn178 / js-md5

A simple MD5 hash function for JavaScript supports UTF-8 encoding.
MIT License
787 stars 427 forks source link

Doesn't work correctly in Electron #47

Open simonhamp opened 1 month ago

simonhamp commented 1 month ago

Some NativePHP users are experiencing this issue via Filament, an open source component library and admin panel solution for Laravel.

It seems that under Electron, this check returns true when it's not expected to:

var NODE_JS = !root.JS_MD5_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;

Is there something you could do to fix this? Or is there maybe a build option on the Filament side that might help?

emn178 commented 1 month ago

Try to set global.JS_MD5_NO_NODE_JS = true before require js-md5. global may have a different name in your environment.