Skip to content

Users shouldn't have to define a "start" script for being able to run "envio dev" #568

@PaulRBerg

Description

@PaulRBerg

I want to run envio dev, but I am unable to do it because I don't have a start script defined in my package.json:

See error log

> generated@0.1.0 db-setup /Users/prb/Sablier/indexers/src/envio/flow/bindings
> node -e 'require(`./src/db/Migrations.bs.js`).runUpMigrations(true, true)'

[16:14:35.253] INFO (79060): Tracking tables in Hasura

Starting indexer
npm warn Unknown env config "verify-deps-before-run". This will stop working in the next major version of npm.
npm error Missing script: "start"
npm error
npm error Did you mean one of these?
npm error   npm star # Mark your favorite packages
npm error   npm stars # View packages marked as favorites
npm error
npm error To see a list of scripts, run:
npm error   npm run
npm error A complete log of this run can be found in: /Users/prb/.npm/_logs/2025-06-04T13_14_36_302Z-debug-0.log
Error: Failed cli execution

Caused by:
    0: Failed running start on the indexer
    1: Indexer crashed. For more details see the error logs above the TUI. Can't find them? Restart the indexer with the 'TUI_OFF=true pnpm start' command.
error: Recipe `dev` failed on line 33 with exit code 1

This is problematic due to multiple reasons:

  1. A command in an external dependency like envio should NOT depend upon user-defined scripts. Envio should do whatever has to be done in the start script by itself. Envio should be able to infer the path to the Index.bs.js file from the generated directory.
  2. The user may not use package.json#scripts. For instance, we use Just for running commands.
  3. The error is confusing and hard to debug. At a minimum, Envio should provide guidance to the user regarding what logic has to be added in the start script.

So please make it possible to not have to define a start script in order to be able to run envio dev.


The fix, for the moment, is to add a start script like so:

"start": "ts-node generated/src/Index.bs.js"

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