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

We had a problem with Magento Cloud during launch "magepack generate" #137

Open
sekam opened this issue Mar 30, 2022 · 3 comments
Open

We had a problem with Magento Cloud during launch "magepack generate" #137

sekam opened this issue Mar 30, 2022 · 3 comments

Comments

@sekam
Copy link

sekam commented Mar 30, 2022

We had a problem with Magento Cloud during launch "magepack generate"

W:
W: ERROR Failed to launch the browser process!
W: /app/.nvm/versions/node/v10.24.1/lib/node_modules/magepack/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory

We added in the .magento.app.yaml (by recommendations https://support.magento.com/hc/en-us/articles/360022507012-Configure-NPM-to-be-able-to-use-PWA-Studio)

hooks:
    # We run build hooks before your application has been packaged.
    build: |
        set -e
        echo "Node Js Version re: MDVA-29720"
        node --version
        echo "Installing NVM"
        unset NPM_CONFIG_PREFIX
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
        export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
        [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
        nvm install 10
        nvm use 10
        echo "Node Js Version re: MDVA-29720"
        node --version
        npm install -g magepack
@krzksz
Copy link
Collaborator

krzksz commented Mar 30, 2022

Hey, it is not advised to run bundle generation during CI. You can do that, but as you can see it is problematic and I am unable to support all server configurations to make it work for everybody.

Ideally, you should generate configuration locally, commit magepack.config.js file to the repo and use it to bundle during CI.

@fredden
Copy link
Contributor

fredden commented Mar 30, 2022

You may like to add npm config set puppeteer_skip_chromium_download true -g before npm install -g magepack. This is what we use with success on Cloud to run magepack bundle. (We run magepack generate locally and commit magepack.config.js per above recommendation.)

The snippet you pasted above from .magento.app.yaml doesn't include running any magepack commands, so it's hard to see what's going on / help you further. Here's a known-working 'build' step:

    build: |
        set -e
        unset NPM_CONFIG_PREFIX
        curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.1/install.sh | bash
        export NVM_DIR="$HOME/.nvm"
        [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
        nvm install 12.13
        npm config set puppeteer_skip_chromium_download true -g
        npm install magepack -g
        php ./vendor/bin/ece-tools build:generate
        magepack bundle
        php ./vendor/bin/ece-tools build:transfer

@mrtuvn
Copy link

mrtuvn commented Aug 12, 2022

hi @fredden. Interesting problem
Is this may cause fail building cloud ? without text "npm config set puppeteer_skip_chromium_download true -g" build process will fail

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