Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error github action during shopify hydrogen deployment #1945

Closed
2 tasks done
bitforcesrl opened this issue Apr 5, 2024 · 9 comments
Closed
2 tasks done

[Bug]: Error github action during shopify hydrogen deployment #1945

bitforcesrl opened this issue Apr 5, 2024 · 9 comments

Comments

@bitforcesrl
Copy link

Please confirm that you have:

  • 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.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

Hydrogen custom storefront

Expected behavior

The actions should succeed

Actual behavior

After merging the pull request created from the shopify bot the github action step "Build and Publish to Oxygen" fails.

Verbose output

Run npx shopify hydrogen deploy --build-command "yarn build"
  npx shopify hydrogen deploy --build-command "yarn build"
  shell: /usr/bin/bash -e {0}
  env:
    SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN: ***

  ERROR Raw mode is not supported on the current process.stdin, which Ink uses
The above error occurred in the <SelectPrompt> component:

       as input stream by default.
    at SelectPrompt (file:///home/runner/work/tooa-app/tooa-app/node_modules/@shopify/cli-kit/dist/private/node/ui/components/SelectPrompt.js:12:25)
    at App (file:///home/runner/work/tooa-app/tooa-app/node_modules/ink/build/components/App.js:18:9)

React will try to recreate this component tree from scratch using the error boundary you provided, InternalApp.
       Read about how to prevent this error on
       https://github.com/vadimdemedes/ink/#israwmodesupported

 - Read about how to prevent this error on
   https://github.com/vadimdemedes/ink/#israwmodesupported
 - value (node_modules/ink/build/components/App.js:46:31)
 -  (node_modules/ink/build/hooks/use-input.js:34:9)
 -commitHookEffectLis (node_modules/react-reconciler/cjs/react-reconciler.devel
  Mount              opment.js:14778:26)
 -commitPassiveMountO (node_modules/react-reconciler/cjs/react-reconciler.devel
  Fiber              opment.js:16609:11)
 -commitPassiveMountEffect (node_modules/react-reconciler/cjs/react-reconciler.
  _complete               development.js:16569:9)
 -commitPassiveMountEffe (node_modules/react-reconciler/cjs/react-reconciler.de
  ts_begin              velopment.js:16556:7)
 -commitPassiveMountE (node_modules/react-reconciler/cjs/react-reconciler.devel
  fects              opment.js:16544:3)
 -flushPassiveEffect (node_modules/react-reconciler/cjs/react-reconciler.develo
  Impl              pment.js:19182:3)
 -flushPassiveEff (node_modules/react-reconciler/cjs/react-reconciler.developme
  cts            nt.js:19127:14)
 -performSyncWorkOn (node_modules/react-reconciler/cjs/react-reconciler.develop
  oot              ment.js:18184:3)

Reproduction steps

Run the github actions to deploy on oxygen

Operating System

github action

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

latest

Shell

No response

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

v20

What language and version are you using in your application?

No response

@gonzaloriestra gonzaloriestra transferred this issue from Shopify/cli Apr 5, 2024
@graygilmore
Copy link
Contributor

@bitforcesrl 👋🏻 can you confirm which version of cli-hydrogen you're trying to use? The deploy command was marked as stable in v7.

@bitforcesrl
Copy link
Author

bitforcesrl commented Apr 15, 2024

@graygilmore we are executing the following command via GitHub Actions:
npx shopify hydrogen deploy --build-command "yarn build"

The GitHub Actions we are using are those generated automatically by Oxygen

# Don't change the line below!
#! oxygen_storefront_id: xxxx

name: Storefront xxxx
on:
- push
permissions:
  contents: read
  deployments: write
jobs:
  deploy:
    name: Deploy to Oxygen
    timeout-minutes: 30
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Setup node.js
      uses: actions/setup-node@v4
      with:
        node-version: lts/*
        check-latest: true
    - name: Get yarn cache directory
      id: yarn-cache-dir-path
      run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
    - uses: actions/cache@v4
      with:
        path: "${{ steps.yarn-cache-dir-path.outputs.dir }}"
        key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
        restore-keys: "${{ runner.os }}-yarn-\n"
    - name: Install dependencies
      id: install-dependencies
      run: yarn
    - name: Build and Publish to Oxygen
      id: deploy
      run: npx shopify hydrogen deploy --build-command "yarn build"
      env:
        SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN: "${{ secrets.OXYGEN_DEPLOYMENT_TOKEN_688471 }}"


@graygilmore
Copy link
Contributor

Thanks! Unfortunately that doesn't say what version of cli-hydrogen you are running. What does your package.json say for that dependency? And what is committed as the version to your lockfile?

@bitforcesrl
Copy link
Author

We are using cli-hydrogen v4.0.3.
I've updated the dependency to the latest version (v8) but now we have another problem, we need to update remix to v2 because the cli requires it.
Is there a guide to migrate our code base from remix 1 to remix 2?
Thank you

@wizardlyhel
Copy link
Contributor

Hey @bitforcesrl, please follow this and turn on all the v2 future flags in your project #739

Since your project is quite behind, I wonder if it is better to just regenerate a new project and copy your existing project into the new project. Your project is most likely require a very strict dependency between all the Remix, Shopify package versions and if you bump any package's versions, the project might not even run. Since Hydrogen v2023.10.0, Remix becomes a peer dependency along with many other Remix and Shopify packages ... and trying to carefully upgrade your project through all of these changes would be challenging.

We introduced a h2 upgrade in 2023.10.0 cli command that should work retroactively if you can get your project to Hydrogen 2023.1.0. Maybe give this a try? but only run this command after you have turn on all v2 future flags.

@blittle
Copy link
Contributor

blittle commented Apr 17, 2024

Also check out Remix's guide here: https://remix.run/docs/en/main/start/v2

@bitforcesrl
Copy link
Author

Thanks for the advice. The project it's quite big.
It's deployed in a capacitor app on android and apple stores and it runs code to control a robot machine via bluetooth that makes ice cream. Plus in the app there are pages that show products that are on the shopify e-commerce.
Migrating it to a new project structure will be challenging too.
when the current git hub actions will be deprecated?
https://www.tooa.com/en/products/macchina-gelato-bupt0000

@graygilmore
Copy link
Contributor

when the current git hub actions will be deprecated?

No immediate plans to remove the action but important to note that it won't be receiving any new features. For example, end-to-end testing with authentication bypass tokens is only available through the updated cli-hydrogen package.

@graygilmore
Copy link
Contributor

Closing as this isn't a bug with the deploy command.

@graygilmore graygilmore closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants