From 9837c23fee44d1384468845ab0770c7533fa38c4 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Wed, 2 Oct 2024 11:54:06 -0400 Subject: [PATCH 1/2] fix: add more actionable info for missing primaryRegion When using a version of `netlify-cli` older than [17.23.4](https://github.com/netlify/cli/pull/6589), you would encounter this error when using Blobs. The fix is pretty simple but not at all obvious. --- src/store_factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store_factory.ts b/src/store_factory.ts index dfe1c13..3daa5d8 100644 --- a/src/store_factory.ts +++ b/src/store_factory.ts @@ -30,7 +30,7 @@ export const getDeployStore = (input: GetDeployStoreOptions | string = {}): Stor // eslint-disable-next-line max-depth if (!context.primaryRegion) { throw new Error( - 'When accessing a deploy store, the Netlify Blobs client needs to be configured with a region, and one was not found in the environment. To manually set the region, set the `region` property in the `getDeployStore` options.', + 'When accessing a deploy store, the Netlify Blobs client needs to be configured with a region, and one was not found in the environment. To manually set the region, set the `region` property in the `getDeployStore` options. If you are seeing this via the Netlify CLI, you may have an oudated version; run `npm install -g netlify-cli@latest` to update and try again.', ) } From 453c2543f1bffa07e024459308f619e52d633263 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Fri, 11 Oct 2024 10:08:56 -0400 Subject: [PATCH 2/2] fix: improve error message copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Eduardo Bouças --- src/store_factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store_factory.ts b/src/store_factory.ts index 3daa5d8..420cfc2 100644 --- a/src/store_factory.ts +++ b/src/store_factory.ts @@ -30,7 +30,7 @@ export const getDeployStore = (input: GetDeployStoreOptions | string = {}): Stor // eslint-disable-next-line max-depth if (!context.primaryRegion) { throw new Error( - 'When accessing a deploy store, the Netlify Blobs client needs to be configured with a region, and one was not found in the environment. To manually set the region, set the `region` property in the `getDeployStore` options. If you are seeing this via the Netlify CLI, you may have an oudated version; run `npm install -g netlify-cli@latest` to update and try again.', + 'When accessing a deploy store, the Netlify Blobs client needs to be configured with a region, and one was not found in the environment. To manually set the region, set the `region` property in the `getDeployStore` options. If you are using the Netlify CLI, you may have an outdated version; run `npm install -g netlify-cli@latest` to update and try again.', ) }