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
In a project with "type": "module" in the package.json that uses the vm2 package (or any other package that uses the __dirname or __filename variables), the generated output throws an Error:
`(function(global) {"use strict"; const exports = {};${fs.readFileSync(`${__dirname}/bridge.js`, 'utf8')}\nreturn exports;})`);
ReferenceError: __dirname is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and 'C:\ph\ProcessHub_master\app\distncc\package.json' contains "type": "module". To
treat it as a CommonJS script, rename it to use the '.cjs' file extension.
The project runs without problems when starting with node. I think __dirname and __filename should be removed from the ncc build?
The text was updated successfully, but these errors were encountered:
In a project with
"type": "module"
in the package.json that uses the vm2 package (or any other package that uses the__dirname
or__filename
variables), the generated output throws an Error:The project runs without problems when starting with node. I think __dirname and __filename should be removed from the ncc build?
The text was updated successfully, but these errors were encountered: