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?

Reply

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
Reply
Join the discussion
Create an account Log in

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

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

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