Skip to content

rails new website --js=esbuild silently fails when yarn isn't installed #220

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

Open
j127 opened this issue May 1, 2025 · 0 comments
Open

Comments

@j127
Copy link

j127 commented May 1, 2025

rails new silently fails when yarn isn't installed, resulting in a broken project.

Steps to reproduce

Create a new Rails project like this:

rails _8.0.2_ new my_website --js=esbuild --css=tailwind --database=postgresql

Expected behavior

The command should fail because the resulting project is broken.

Actual behavior

The project gets generated, but it's broken due to no npm dependencies.

Here's the resulting package.json which is missing tailwind, esbuild, and hotwire dependencies:

{
  "name": "app",
  "private": true,
  "scripts": {
    "build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets",
    "build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
  }
}

System configuration

Rails version: 8.0.2

Ruby version: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]

(M1 MacBook)

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

No branches or pull requests

1 participant