hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

Can't link storefront

Open theocerutti opened this issue 2 years ago • 0 comments

Please confirm that you have:

  • [X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • [X] Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Other

Expected behavior

I can run h2 login or h2 link to link my storefront.

Actual behavior

When I run h2 link command there is an error: "ERROR SelectPrompt requires at least one choice"

SOLUTION: Actually I had to do h2 logout (however it was a repository that I just pulled, so it's weird)

Verbose output

ERROR  SelectPrompt requires at least one choice

 node_modules/@shopify/cli-hydrogen/node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:9:15

  6: // eslint-disable-next-line react/function-component-definition
  7: function SelectPrompt({ message, choices, infoTable, infoMessage, gitDiff, onSubmit, defaultValue, abortSignal, }) {
  8:     if (choices.length === 0) {
  9:         throw new Error('SelectPrompt requires at least one choice');
 10:     }
 11:     const { exit: unmountInk } = useApp();
 12:     const { promptState, setPromptState, answer, setAnswer } = usePrompt({

 - SelectPrompt (node_modules/@shopify/cli-hydrogen/node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:9:15)
 - renderWithHooks (node_modules/react-reconciler/cjs/react-reconciler.development.js:7478:18)
 - mountIndeterminateComponent (node_modules/react-reconciler/cjs/react-reconciler.development.js:11247:13)
 - beginWork (node_modules/react-reconciler/cjs/react-reconciler.development.js:12760:16)
 - beginWork$1 (node_modules/react-reconciler/cjs/react-reconciler.development.js:19569:14)
 - performUnitOfWork (node_modules/react-reconciler/cjs/react-reconciler.development.js:18703:12)
 - workLoopSync (node_modules/react-reconciler/cjs/react-reconciler.development.js:18609:5)
 - renderRootSync (node_modules/react-reconciler/cjs/react-reconciler.development.js:18577:7)
 - performSyncWorkOnRoot (node_modules/react-reconciler/cjs/react-reconciler.development.js:18193:20)
 - flushSyncCallbacks (node_modules/react-reconciler/cjs/react-reconciler.development.js:2936:22)

Reproduction steps

  1. Pull a hydrogen repository that has already been setup (but you didn't link it)
  2. Run h2 link
  3. Error

Operating System

linux

Shopify CLI version (check your project's package.json if you're not sure)

^5.5.1

Shell

No response

Node version (run node -v if you're not sure)

lts/iron

What language and version are you using in your application?

No response

theocerutti avatar Oct 27 '23 23:10 theocerutti