We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-
The swc CLI fails to correctly parse filenames that start with a - (dash) character. Albeit an odd file name, it should still be treated as valid.
swc
swc compile --config-file .swcrc --source-file-name -3-d-world.ts --out-file -3-d-world.js
{ "$schema": "https://json.schemastore.org/swcrc", "jsc": { "parser": { "syntax": "typescript", "decorators": true }, "transform": { "legacyDecorator": true, "decoratorMetadata": true } } }
https://play.swc.rs/?version=1.11.5&code=H4sIAAAAAAAAA0utKMgvKlEoqSxIVYg3dgnPL8pJUbBVUM8tTc5QV6hRUC%2FPL1e3BgAMZnHUJgAAAA%3D%3D&config=H4sIAAAAAAAAA1VPOw7DIAzdOQXy3KFi6NA79BCIOhERAYQdqSjK3QsJpM1mv4%2Ff8yqkhIkMPOVaxrJEnQjTuReEsmf9KQhwjkgm2chw6yxTpQbtCHdoOxhgnUbk6kJSd6WaA1wIhN3RsNl6O%2BT%2FTBPmmJDoKqxS7UeH10TRUmEO72Un2y%2B179HgAT9RDzsPg6VXd3JaUGxfBMLf3xcBAAA%3D
Operating System: Platform: linux Arch: x64 Machine Type: x86_64 Version: #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025 CPU: (4 cores) Models: Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: N/A pnpm: 9.15.3 Relevant Packages: @swc/core: 1.11.5 @swc/helpers: N/A @swc/types: N/A typescript: 5.1.6 SWC Config: output: N/A .swcrc path: N/A Next.js info: output: N/A
The CLI tool should correctly ingest and compile the file.
Depending on the options passed I get the following errors:
First variation:
If you tried to supply `-3` as a value rather than a flag, use `-- -3` USAGE: swc-linux-x64-gnu compile [OPTIONS] [FILES]...
Second variation:
error: unknown option '-3-d-world.ts'
1.11.5
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The
swc
CLI fails to correctly parse filenames that start with a-
(dash) character. Albeit an odd file name, it should still be treated as valid.Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.11.5&code=H4sIAAAAAAAAA0utKMgvKlEoqSxIVYg3dgnPL8pJUbBVUM8tTc5QV6hRUC%2FPL1e3BgAMZnHUJgAAAA%3D%3D&config=H4sIAAAAAAAAA1VPOw7DIAzdOQXy3KFi6NA79BCIOhERAYQdqSjK3QsJpM1mv4%2Ff8yqkhIkMPOVaxrJEnQjTuReEsmf9KQhwjkgm2chw6yxTpQbtCHdoOxhgnUbk6kJSd6WaA1wIhN3RsNl6O%2BT%2FTBPmmJDoKqxS7UeH10TRUmEO72Un2y%2B179HgAT9RDzsPg6VXd3JaUGxfBMLf3xcBAAA%3D
SWC Info output
Operating System:
Platform: linux
Arch: x64
Machine Type: x86_64
Version: #25~22.04.1-Ubuntu SMP Tue Jan 28 12:51:22 UTC 2025
CPU: (4 cores)
Models: Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
Expected behavior
The CLI tool should correctly ingest and compile the file.
Actual behavior
Depending on the options passed I get the following errors:
First variation:
Second variation:
Version
1.11.5
Additional context
No response
The text was updated successfully, but these errors were encountered: