Skip to content

Doctor returns non-zero for missing generated bin/dev in custom projects #3103

@justin808

Description

@justin808

Summary

react_on_rails:doctor currently returns non-zero for some findings that look like guidance/suggestions rather than real setup errors.

In a custom app that does not use the generated React on Rails bin/dev launcher, doctor reports a missing bin/dev script as an error and exits with status 1, even though the actual React on Rails integration is otherwise healthy and functional.

I think this is too strict for custom projects.

Reproduction context

App characteristics:

  • React on Rails Pro 16.6.0
  • Shakapacker 9.5.0
  • Custom ./dev launcher using Overmind + Procfile
  • Custom webpack/rspack setup
  • SSR working
  • gem/npm versions aligned exactly

Doctor output includes:

  • exact version checks passing
  • React on Rails gem/npm alignment passing
  • Pro setup passing
  • but missing bin/dev is counted as an error

Relevant output:

bin/dev Launcher Setup:
-----------------------
🚀 bin/dev Launcher:
  🚫 bin/dev script not found

and later:

❌ Issues found: 1 error(s), 8 warning(s)

Why this seems wrong

The current output mixes together:

  • real errors
  • warnings
  • recommendations / generated-default guidance

Missing the generated React on Rails bin/dev launcher is not necessarily a broken setup. A project may intentionally use a custom launcher and custom Procfiles.

In my case, the app has:

  • a working custom ./dev
  • working Procfile, Procfile.dev-static-assets, Procfile.dev-prod-assets
  • working Node renderer setup
  • working SSR
  • passing version consistency checks

So the doctor status ends up non-zero because of a generated-default assumption, not because the app is actually misconfigured.

Suggested behavior

I think doctor should reserve error for likely broken runtime/setup invariants, such as:

  • missing Node
  • missing package manager
  • gem/npm version mismatch
  • missing required initializer
  • invalid package combination

And it should classify the following as warnings or informational suggestions instead:

  • missing bin/dev
  • missing Procfile.dev
  • recommendation to use private_output_path
  • both webpack and rspack configs present
  • custom launcher / custom bundler heuristics

Concrete suggestion

1. Downgrade missing bin/dev from error to warning

Today check_bin_dev_launcher_setup uses add_error when bin/dev is absent.

That should probably be a warning instead.

2. Detect custom launchers before warning aggressively

If the app has indicators like:

  • ./dev
  • Procfile
  • overmind / foreman usage
  • custom Procfile variants

then doctor could say something like:

Custom launcher detected; official React on Rails bin/dev not found.
This is OK if your project intentionally manages its own dev workflow.

3. Keep the recommendation, but don’t fail the doctor

It is still useful to tell users about the generated launcher and newer workflow. That should stay in the output, but as guidance, not as a hard failure.

Extra note

There is also a small inconsistency in current severity choices:

  • missing bin/dev is an error
  • missing Procfile.dev is only a warning
  • missing server bundle file is only a warning

That makes the overall severity feel a bit uneven.

Expected outcome

For custom projects, react_on_rails:doctor should:

  • return zero if only recommendations/warnings are present
  • return non-zero only when actual errors are present

That would make doctor much more usable in CI and for real setup validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions