Open huseeiin opened 1 month ago
The issue is not coming from bun, it's an issue of one of the dependencies that are responsible of cli argument parsing (clap
)
clap.parseParam("--sourcemap <STR>? Build with sourcemaps - 'inline', 'external', or 'none'") catch unreachable,
the ?
is what's making it behave like that
Note that we have forked clap and have made many changes to it, I would consider this a bug in bun
@Jarred-Sumner will take a look and fix it
@Jarred-Sumner after looking at the issue closely, I think using =
should be mandatory for flags that takes an optional value to differentiate between actually passing a value to the flag or just using the default value of the flag for certain situations like the following:
Optional case with no value:
bun-debug --inspect main.ts
In this case it knows that --inspect
will get whatever the default value for the flag is, and not use main.ts
as a value to --inspect
Optional case with value:
bun-debug --inspect=ws://localhost:6499/foo/bar main.ts
In this case it knows that --inspect
expects a value and not use the default one because of =
What version of Bun is running?
1.1.20+ae1948925
What platform is your computer?
Linux 6.5.0-18-generic x86_64 x86_64
What steps can reproduce the bug?
this doesn't work:
but this works:
What is the expected behavior?
both should work
What do you see instead?
error: ModuleNotFound resolving "external" (entry point)
Additional information
No response