You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when running a migration command with project and dataset options i.e.:
sanity migration run <migration_id> --project <project_id> --dataset <dataset>
where both project_id and dataset are defined and correct an error is thrown:
Error: sanity.cli.js does not contain a project identifier ("api.projectId"), which is required for the Sanity CLI to communicate with the Sanity API
To Reproduce
create a simple migration script with sanity, sanity migration create
and follow the prompt
make sure there is no sanity.cli.js in your codebase
according to the prompt:
Migration created!
Next steps:
Open /code/migrations/migration_id/index.ts in your code editor and write the code for your migration.
Dry run the migration with: sanity migration run migration_id --project=<projectId> --dataset <dataset>
Run the migration against a dataset with: sanity migration run migration_id --project=<projectId> --dataset <dataset> --no-dry-run
edit the script and run it as: sanity migration run migration_id --project=real_project_id --dataset real_dataset
you will get an error specified above
Expected behavior
My assumption is that b/c I provide the project id and dataset name in the command I do not need to specify a separate configuration file i.e. sanity.cli.ts. Indeed, creating such a file and providing project id and dataset names in there causes the command to run without any error. But why then I have a possibility to run this command specifying the needed parameters as the command options?
Screenshots
If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
3.56.0
The text was updated successfully, but these errors were encountered:
Describe the bug
when running a migration command with project and dataset options i.e.:
sanity migration run <migration_id> --project <project_id> --dataset <dataset>
where both project_id and dataset are defined and correct an error is thrown:
To Reproduce
sanity migration create
and follow the prompt
sanity.cli.js
in your codebaseedit the script and run it as:
sanity migration run migration_id --project=real_project_id --dataset real_dataset
Expected behavior
My assumption is that b/c I provide the project id and dataset name in the command I do not need to specify a separate configuration file i.e.
sanity.cli.ts.
Indeed, creating such a file and providing project id and dataset names in there causes the command to run without any error. But why then I have a possibility to run this command specifying the needed parameters as the command options?Screenshots
If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
3.56.0
The text was updated successfully, but these errors were encountered: