Skip to content

Doesn't work with standalone bun 1.2.5 #1079

New issue

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

Closed
iwdt opened this issue Mar 12, 2025 · 0 comments · Fixed by #1083
Closed

Doesn't work with standalone bun 1.2.5 #1079

iwdt opened this issue Mar 12, 2025 · 0 comments · Fixed by #1083

Comments

@iwdt
Copy link

iwdt commented Mar 12, 2025

When I use bun 1.2.5, it gives an error related to the absence of node.js

  • OS: Debian 12

    $ cat /etc/os-release 
    PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
    NAME="Debian GNU/Linux"
    VERSION_ID="12"
    VERSION="12 (bookworm)"
    VERSION_CODENAME=bookworm
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
  • Bun: 1.2.5, installed via

    $ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5"
  • Extension: chenglou92.rescript-vscode 1.62.0

  • Node.js not installed

  • Package.json:

{
  "name": "my_app",
  "private": true,
  "scripts": {
    "build:res": "NODE_ENV=production rescript",
    "build:js": "NODE_ENV=production bun config/bun.config.js",
    "build": "bun run build:res && bun run build:js",
    "build:css": "NODE_ENV=production postcss --config ./config/postcss.config.js ./app/assets/stylesheets/application.css -o ./app/assets/builds/application.css",
    "dev:res": "bun run build:res -w",
    "dev:js": "bun run build:js -w",
    "dev:css": "bun run build:css -w"
  },
  "dependencies": {
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@rescript/core": "^1.6.1",
    "@rescript/react": "^0.13.1",
    "reanalyze": "^2.23.0",
    "rescript": "^11.1.4",
    "autoprefixer": "^10.4.21",
    "cssnano": "^7.0.6",
    "postcss": "^8.5.3",
    "postcss-cli": "^11.0.0",
    "postcss-import": "^16.1.0",
    "postcss-nesting": "^13.0.1"
  },
  "trustedDependencies": [
    "reanalyze",
    "rescript"
  ]
}

Got error:

Image

But if I fix it manually in the file node_modules/.bin/rescript first line:

from

#!/usr/bin/env node

to

#!/usr/bin/env bun

It's works!

also, if you call bun directly with this file, then everything works:

Image

or call using bun scripts:

Image

Maybe add the ability to configure which interpreter can be used to call this script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant