-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
vite-node fails to parse hashbang #1175
Copy link
Copy link
Closed
Description
Describe the bug
When a file has a hashbang/shebang (most often #!/usr/bin/env node), vite-node fails with this error:
Error: Parse failure: Unexpected character '!' (1:1)
Contents of line 1: #!/usr/bin/env node
Reproduction
StackBlitz link: https://stackblitz.com/edit/node-fhzvli.
System Info
System:
OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
Memory: 1.02 GB / 3.72 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
npmPackages:
vite: ^2.9.5 => 2.9.5
vitest: ^0.9.3 => 0.9.3Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels