#failed to run CLI runMigration

4 messages · Page 1 of 1 (latest)

magic widget
#

trying to run the helper runMigration from the CLI

pnpx convex run lib.migrations:runMigration '{ "name": "migration.populatePurchaseOrders" }'

and i get this error:

Failed to run function "lib.migrations:runMigration":
Error: {"code":"BadConvexFunctionIdentifier","message":"lib.migrations:runMigration is not a valid path to a Convex function. Module path (lib.migrations) has an extension that isn't 'js'."}

btw it does work from convex dashboard

vocal aspen
#

The error message could be better here, but I believe the format here is lib/migrations:runMigration (and also probably migration:populatePurchaseOrders)

(Generally path/to/file:exportName)

magic widget
vocal aspen
#

Ah thanks for pointing that out -- will look into updating that.

There may or may not be work coming up to get npx convex run to accept more formats (like api.lib.migrations.runMigration which we use elsewhere)