Medusajs build failed for the same git commit
greetwell
PROOP

2 years ago

I had a medusa node js server which I was deploying successfully a week or so ago. Now it is failing and I tired by reverting back to the same git commit but still getting the same error. Want to understand what changed?

Build Log:

#10 90.58 success Saved lockfile.

#10 90.59 Done in 89.97s.

#10 DONE 91.2s

#11 [stage-0 7/10] COPY . /app/.

#11 DONE 0.1s

#12 [stage-0 8/10] RUN --mount=type=cache,id=s/6d374d04-e89f-4ec2-83ff-b76c44ed9812-node_modules/cache,target=/app/node_modules/.cache yarn build

#12 0.548 yarn run v1.22.19

#12 0.582 $ cross-env npm run clean && npm run build:server && npm run build:admin

#12 1.217 npm

WARN config production Use --omit=dev instead.

#12 1.329

#12 1.329 > medusa-starter-default@0.0.1 clean

#12 1.329 > cross-env ./node_modules/.bin/rimraf dist

#12 1.329

#12 1.897 npm

WARN config production Use --omit=dev instead.

#12 1.981

#12 1.981 > medusa-starter-default@0.0.1 build:server

#12 1.981 > cross-env npm run clean && tsc -p tsconfig.server.json

#12 1.981

#12 2.461 npm

WARN config production Use --omit=dev instead.

#12 2.534

#12 2.534 > medusa-starter-default@0.0.1 clean

#12 2.534 > cross-env ./node_modules/.bin/rimraf dist

#12 2.534

#12 7.586 error TS2688: Cannot find type definition file for 'mime'.

#12 7.586 The file is in the program because:

#12 7.586 Entry point for implicit type library 'mime'

#12 7.649 error Command failed with exit code 2.

#12 7.650 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

#12 ERROR: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 2


[stage-0 8/10] RUN --mount=type=cache,id=s/6d374d04-e89f-4ec2-83ff-b76c44ed9812-node_modules/cache,target=/app/node_modules/.cache yarn build:

WARN config production Use --omit=dev instead.

2.534

2.534 > medusa-starter-default@0.0.1 clean

2.534 > cross-env ./node_modules/.bin/rimraf dist

2.534

7.586 error TS2688: Cannot find type definition file for 'mime'.

7.586 The file is in the program because:

7.586 Entry point for implicit type library 'mime'

7.649 error Command failed with exit code 2.

7.650 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


Dockerfile:24


22 | # build phase

23 | COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/6d374d04-e89f-4ec2-83ff-b76c44ed9812-node_modules/cache,target=/app/node_modules/.cache yarn build

25 |

26 |


ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 2

Error: Docker build failed

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

Solved

9 Replies

2 years ago

Would you happen to have a nixpacks.toml file in your repo?


greetwell
PROOP

2 years ago

Thanks brody. I do and it hasn't changed from the build when it was sucessful

nixpacks.toml (Copied from Medusa doc https://docs.medusajs.com/deployments/server/deploying-on-railway#optional-step-1-add-nixpacks-configurations)

[phases.setup]

nixPkgs = ['nodejs', 'yarn']

[phases.install]

cmds=['yarn install']


2 years ago

That nixpacks.toml has broken many medusa builds on Railway, and there is an open PR to remove it from their docs.

So please set a NIXPACKS_NO_CACHE service variable to 1 and then remove the nixpacks.toml from your repo.


greetwell
PROOP

2 years ago

Tried setting NIXPACKS_NO_CACHE and removing nixpacks.toml. No luck, same error

#10 47.69 npm WARN deprecated @oclif/errors@1.3.6: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 47.97 npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.

#10 47.97 npm WARN deprecated domexception@2.0.1: Use your platform's native DOMException instead

#10 47.98 npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead

#10 48.15 npm WARN deprecated @oclif/parser@3.8.17: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 48.20 npm WARN deprecated @oclif/config@1.18.17: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 49.25 npm WARN deprecated cli-ux@5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 50.17 npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.

#10 50.21 npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.

#10 62.33 npm WARN deprecated @oclif/errors@1.3.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 62.50 npm WARN deprecated @oclif/config@1.18.16: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 62.86 npm WARN deprecated @oclif/config@1.18.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 72.26 npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

#10 93.78

#10 93.78 added 2083 packages, and audited 2084 packages in 2m

#10 93.78

#10 93.78 341 packages are looking for funding

#10 93.78 run npm fund for details

#10 93.92

#10 93.92 18 vulnerabilities (9 moderate, 6 high, 3 critical)

#10 93.92

#10 93.92 To address issues that do not require attention, run:

#10 93.92 npm audit fix

#10 93.92

#10 93.92 To address all issues (including breaking changes), run:

#10 93.92 npm audit fix --force

#10 93.92

#10 93.92 Run npm audit for details.

#10 DONE 94.3s

#11 [ 7/10] COPY . /app/.

#11 DONE 0.1s

#12 [ 8/10] RUN yarn build

#12 0.335 /bin/bash: line 1: yarn: command not found

#12 ERROR: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 127


> [ 8/10] RUN yarn build:

0.335 /bin/bash: line 1: yarn: command not found


Dockerfile:24


22 | # build phase

23 | COPY . /app/.

24 | >>> RUN yarn build

25 |

26 |


ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 127

Error: Docker build failed


2 years ago

That is not the same error, but use this and attach your full build logs please -

https://bookmarklets.up.railway.app/log-downloader/


greetwell
PROOP

2 years ago

Thanks brody, not able to make this bookmarklet work with Arc browser. This is the complete Build Log (pasted again below). There is no Deployment Log

#10 50.17 npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.

#10 50.21 npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.

#10 62.33 npm WARN deprecated @oclif/errors@1.3.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 62.50 npm WARN deprecated @oclif/config@1.18.16: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 62.86 npm WARN deprecated @oclif/config@1.18.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

#10 72.26 npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

#10 93.78

#10 93.78 added 2083 packages, and audited 2084 packages in 2m

#10 93.78

#10 93.78 341 packages are looking for funding

#10 93.78 run npm fund for details

#10 93.92

#10 93.92 18 vulnerabilities (9 moderate, 6 high, 3 critical)

#10 93.92

#10 93.92 To address issues that do not require attention, run:

#10 93.92 npm audit fix

#10 93.92

#10 93.92 To address all issues (including breaking changes), run:

#10 93.92 npm audit fix --force

#10 93.92

#10 93.92 Run npm audit for details.

#10 DONE 94.3s

#11 [ 7/10] COPY . /app/.

#11 DONE 0.1s

#12 [ 8/10] RUN yarn build

#12 0.335 /bin/bash: line 1: yarn: command not found

#12 ERROR: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 127


> [ 8/10] RUN yarn build:

0.335 /bin/bash: line 1: yarn: command not found


Dockerfile:24


22 | # build phase

23 | COPY . /app/.

24 | >>> RUN yarn build

25 |

26 |


ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn build" did not complete successfully: exit code: 127

Error: Docker build failed


2 years ago

Sorry but I'm going to need the full build logs, please use the bookmarklet on a regular browser.


greetwell
PROOP

2 years ago

Hi brody, downloaded log is attached. It looks same as what I pasted above. Please let me know how can I fix the build. Thanks

Attachments


greetwell
PROOP

2 years ago

Got this fix from medusa discord. Putting the following in package.json made the deployment go through

"resolutions": {

"@types/mime": "3.0.4"

}

npm

"overrides": {

"@types/mime": "3.0.4"

}

Trying to understand what was the problem and how does this fix it? Thanks


Status changed to Solved Railway about 2 years ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...