Gorka Cesium
Gorka Cesium10mo ago

failed to run CLI runMigration

trying to run the helper runMigration from the CLI
pnpx convex run lib.migrations:runMigration '{ "name": "migration.populatePurchaseOrders" }'
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'."}
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
No description
No description
4 Replies
sshader
sshader10mo ago
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)
Gorka Cesium
Gorka CesiumOP10mo ago
oh, i copied from the helper repo
sshader
sshader10mo ago
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)
Gorka Cesium
Gorka CesiumOP10mo ago
super, thanks

Did you find this page helpful?