All threads / Precompile error on hatchbox with yarn 2

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Precompile error on hatchbox with yarn 2

Matthias Orgler asked in Rails

After upgrading to yarn 2, I get the following error when deploying to hatchbox:

-----> Precompiling assets...
Unknown Syntax Error: Unsupported option name ("--no-progress").

$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--skip-builds]
Compiling...
Compilation failed:
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] ...

How can I fix this?

I solved this by adding a yarn install to the deploy script on hatchbox:

-----> Precompiling assets...'
    # Force webpack output so we can debug errors
    if [ -w config/webpacker.yml ]; then sed -i '/webpack_compile_output/ s/false/true/g' config/webpacker.yml; fi
    yarn install
    rbenv exec bundle exec rake assets:precompile
  fi
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 51,723+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.