diff --git a/.changeset/sixty-crews-enjoy.md b/.changeset/sixty-crews-enjoy.md new file mode 100644 index 0000000000..97681f5861 --- /dev/null +++ b/.changeset/sixty-crews-enjoy.md @@ -0,0 +1,5 @@ +--- +'@shopify/app': patch +--- + +Fix concurrent function builds diff --git a/packages/app/src/cli/services/deploy/bundle.ts b/packages/app/src/cli/services/deploy/bundle.ts index 97021cc2ee..79ba2f1ad8 100644 --- a/packages/app/src/cli/services/deploy/bundle.ts +++ b/packages/app/src/cli/services/deploy/bundle.ts @@ -5,6 +5,7 @@ import {renderConcurrent} from '@shopify/cli-kit/node/ui' import {AbortSignal} from '@shopify/cli-kit/node/abort' import {inTemporaryDirectory, mkdirSync, touchFile} from '@shopify/cli-kit/node/fs' import {joinPath} from '@shopify/cli-kit/node/path' +import {exec} from '@shopify/cli-kit/node/system' import {Writable} from 'stream' export interface BundleOptions { @@ -19,6 +20,13 @@ export async function bundleAndBuildExtensions(options: BundleOptions) { await mkdirSync(bundleDirectory) await touchFile(joinPath(bundleDirectory, '.shopify')) + const javyRequired = options.app.allExtensions.some((ext) => ext.features.includes('function')) + if (javyRequired) { + // Force the download of the javy binary in advance to avoid later problems, + // as it might be done multiple times in parallel. https://github.com/Shopify/cli/issues/2877 + await exec('npm', ['exec', '--', 'javy', '--version'], {cwd: options.app.directory}) + } + await renderConcurrent({ processes: options.app.allExtensions.map((extension) => { return {