Demonstration of bug in Bun's shebang parser on files with CRLF line endings accessed through a symbolic link.
To reproduce:
- Clone this repo
cd bun-shebang-crlf-bug
bun link
to register the packagebun link bun-shebang-crlf-bug
to create symlinks in./node_modules
bunx buncrlfbug
orbunx --bun buncrlfbug
Result:
/usr/bin/env: ‘node\r’: No such file or directory
error: "buncrlfbug" exited with code 127
This is a minimal reproduction of the same problem when running, for example:
bunx jscodeshift ...
because jscodeshift
ships with CRLF files. Converting the files to LF avoids the problem.
The CRLF issue does not seem to be a problem when symlinks are not involved.