When the file is imported via an ES Module rather than via commonjs the __dirname global variable does not exist. This is a quick polyfill to add it in when it is not present to try and get it working via ESM as well as commonjs
Currently can't test it works fully as running on an M1 mac so can't run the x86_64 chromium. If you can advise on how to test locally on ARM I'll be able to verify correctly
When the file is imported via an ES Module rather than via commonjs the __dirname global variable does not exist. This is a quick polyfill to add it in when it is not present to try and get it working via ESM as well as commonjs
Currently can't test it works fully as running on an M1 mac so can't run the x86_64 chromium. If you can advise on how to test locally on ARM I'll be able to verify correctly