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
As of esbuild v0.16.1, including yargs in a CommonJS bundle gives me this warning:
▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
../../node_modules/yargs/lib/platform-shims/esm.mjs:20:28:
20 │ __dirname = fileURLToPath(import.meta.url);
╵ ~~~~~~~~~~~
You need to set the output format to "esm" for "import.meta" to work correctly.
which is technically correct, but the whole point of the try block is, of course, to have a fallback for it. Maybe esbuild could detect that scenario (for simple cases)? Or, alternatively, provide guidance as to how to avoid it in yargs?
(In the meantime, I will work around it with a log override.)
The text was updated successfully, but these errors were encountered:
The yargs package contains an ESM shim that checks for
import.meta
support using atry
block:https://github.com/yargs/yargs/blob/2e0ef3c965dd788ec4af0735ce96d66ed9f91cc0/lib/platform-shims/esm.mjs#L18-L23
As of esbuild v0.16.1, including yargs in a CommonJS bundle gives me this warning:
which is technically correct, but the whole point of the
try
block is, of course, to have a fallback for it. Maybe esbuild could detect that scenario (for simple cases)? Or, alternatively, provide guidance as to how to avoid it in yargs?(In the meantime, I will work around it with a log override.)
The text was updated successfully, but these errors were encountered: