@@ -196,17 +196,9 @@ interface TokenRequestResult {
196196}
197197
198198function tokenRequestErrorHandler ( { error, store} : { error : string ; store ?: string } ) {
199- const invalidTargetErrorMessage =
200- `You are not authorized to use the CLI to develop in the provided store${ store ? `: ${ store } ` : '.' } ` +
201- '\n\n' +
202- "You can't use Shopify CLI with development stores if you only have Partner " +
203- 'staff member access. If you want to use Shopify CLI to work on a development store, then ' +
204- 'you should be the store owner or create a staff account on the store.' +
205- '\n\n' +
206- "If you're the store owner, then you need to log in to the store directly using the " +
207- 'store URL at least once before you log in using Shopify CLI. ' +
208- 'Logging in to the Shopify admin directly connects the development ' +
209- 'store with your Shopify login.'
199+ const invalidTargetErrorMessage = `You are not authorized to use the CLI to develop in the provided store${
200+ store ? `: ${ store } ` : '.'
201+ } `
210202
211203 if ( error === 'invalid_grant' ) {
212204 // There's an scenario when Identity returns "invalid_grant" when trying to refresh the token
@@ -219,7 +211,11 @@ function tokenRequestErrorHandler({error, store}: {error: string; store?: string
219211 return new InvalidRequestError ( )
220212 }
221213 if ( error === 'invalid_target' ) {
222- return new InvalidTargetError ( invalidTargetErrorMessage )
214+ return new InvalidTargetError ( invalidTargetErrorMessage , '' , [
215+ 'Ensure you have logged in to the store using the Shopify admin at least once.' ,
216+ 'Ensure you are the store owner, or have a staff account if you are attempting to log in to a development store.' ,
217+ 'Ensure you are using the permanent store domain, not a vanity domain.' ,
218+ ] )
223219 }
224220 // eslint-disable-next-line @shopify/cli/no-error-factory-functions
225221 return new AbortError ( error )
0 commit comments