Deploys failing because of optional dependency

I am getting this error on my builds after moving from Webpacker to Vite Ruby with a Rails 6 app on Ruby 3.2

npm ERR! @esbuild/android-arm not accessible from esbuild

I’ve explicitly marked the android-arm dependency as optional in my package.json

  "optionalDependencies": {
    "esbuild-android-64": "^0.15.18"
  }

I’ve found a couple of StackOverflow discussions

It seems that updating npm would fix it but I’m not sure how to do that with the render.yml In a GitHub Action I would just add another step to build.

Any help would be appreciated.

EDIT
I got it working by deleting the package-lock.json and just using the yarn.lock file. Leaving this in case it helps anyone else.
#rails #vite #ruby

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.