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
nodejs v15 deprecated usage of module.parent to detect if module is loaded or running as standalone: [DEP0144] DeprecationWarning: module.parent is deprecated due to accuracy issues. Please use require.main to find program entry point instead.
however, esbuild throws warning when using require.main: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning) 178 │ if (require.main === module) test();
like the suggestion says, placing try/catch block around it works, but that is anything but elegant.
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out. This is a common pattern so you're right, esbuild should deal with this. I think it should be sufficient to skip warning about require.main if the output format is CommonJS. With other output formats, require may be undefined so it still seems appropriate to warn (and to wrap with try/catch).
nodejs v15 deprecated usage of
module.parent
to detect if module is loaded or running as standalone:[DEP0144] DeprecationWarning: module.parent is deprecated due to accuracy issues. Please use require.main to find program entry point instead.
however, esbuild throws warning when using
require.main
:warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
178 │ if (require.main === module) test();
like the suggestion says, placing try/catch block around it works, but that is anything but elegant.
The text was updated successfully, but these errors were encountered: