-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Railtie yarn check --integrity fails on development #1374
Comments
@doits When is this happening -running binstubs or rake tasks? |
It happened to me when trying to upgrade the binstubs
|
This is happening to me on a fresh install: created a new app (this step seemed to work fine):
created databases:
then tried starting server
output:
yarn-error.log trace
|
I'm running into the same thing with a new Rails 5.2 RC2 app. For me it happened when running Downgrading to 3.3.1 resolves the issue, FYI. |
The same problem ( |
Hey @joeybeninghove I had the same issue when trying to use Active Storage with Rails 5.2rc2. I've done as suggested downgrading webpacker to 3.3.1. However, I'm getting "Could not find rake-12.3.1 in any of the sources" when trying to run my rails console. Executing bundle install doesn't solve it. |
Thanks everyone, just made a PR @guilleiguaran We added that production flag earlier on the yarn install task, which raises integrity error after running It's a bit unintuitive though, consider this example: First, when we ran assets:precompile it executed fine but then it installed deps with production flag (using rake yarn install task), which changed the integrity and when we ran rails server again it threw integrity error. What do you think? |
Just released 3.4.1 ^^ |
@gauravtiwari Nope. Did not help. It appears when I want to create a model:
Output:
|
@afuno Could you please run BTW, this is still an issue: #1374 (comment) |
I am facing the same issue. Can someone please suggest what am I doing wrong here!
Output of
Output of
|
@puneetpandey Have you run |
@gauravtiwari tried running
|
@puneetpandey Great 👍 everything is working now? You need to make sure |
@gauravtiwari |
|
Same problem here using docker.
My dockerfile:
|
Getting the same issue. Followed these upgrade instructions -https://github.com/rails/webpacker#upgrading
Issue:
|
Just dropping a note here to share my experience. I've encountered the exact same issue. I had changed few configuration for NVM, which would have done something related. |
couple of things about docker installation, which sort of works. try
|
Why was this issue closed? What is the solution? What's happening that causes this? |
@kulte I found that running |
Running After disabling the yarn integrity check ( |
Same thing - rails 5.1 with ruby 2.5.3 ... nvm installs vuejs fine, yarn seems to work till I go to start server up. Sudo install yarn doesn't work. Closing / reopening terminal as well as shutting down complete - no fix.
|
The new version of webpacker has this `check_yarn_integrity` option which is enabled in dev. This check does *not* work if node is running in prod mode (see rails/webpacker#1374 (comment)): ``` $ NODE_ENV=production bin/yarn check --integrity yarn check v1.15.0 warning package.json: No license field warning No license field warning Integrity check: Flags don't match error Integrity check failed error Found 1 errors. info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command. ``` Changing `webpack:analyze` to set `RACK_ENV=test` lets us skip running `bin/yarn check --integrity`. Ideally we'd probably set `RACK_ENV=production`, but that gets tricky because there are lots of secrets you need to get past ENVied's checks on startup.
DockerI kept running into this issue while in Docker. The problem was that I was precompiling my app after I copied the entire app in. I.e., my
This essentially overwrote the dependencies yarn installed in Docker with the ones on my local computer, and hence the errors. SolutionAdd the
You're welcome. |
It gets the job done, but the issue keeps reappearing again and again anyway |
I had a yarn.lock file in the root directory of my rails app. Deleting that solved my issue! |
Deleting yarn.lock also fix the issue in my rails 6.0 project .... had issue after upgraded system node from 10 to 12 -v Update: Unfortunately deleting yarn.lock didnt fix the issue in total the message disappears but also I lost the sass on my site (styling was of because some js error). So I reverted the version of node in nvm from 12.0.0 to 10.xx and it worked okay. |
|
I am running into the exact same issue too. I can't get around it using docker. I did update my webpacker.yml config setting Suggestions? Ideas? I have a .dockerignore file ignoring these:
Here is my Dockerfile FROM ruby:2.6.5-alpine
RUN apk update && apk add --no-cache \
bash \
build-base \
nodejs \
yarn \
sqlite-dev \
tzdata
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
RUN yarn install --check-files
RUN gem install bundler
COPY Gemfile Gemfile.lock /usr/src/app/
RUN bundle install --binstubs
COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh
COPY . /usr/src/app
CMD ["/usr/src/app/entrypoint.sh"] |
Got the same thing with a fresh Docker build.
Adding
|
Thank you very much. You help me too much. AH. My mac was almost broken by me. You saved it. |
For anyone using
|
This is what worked for me. I was "dockering" a rails 6 app |
I use |
If you can, use node 10 or 12. Node 8 is End of Life:
If you do need to use 8, make sure you set the default and at least use the latest version by excluding those explicit zeros. eg: nvm install 8
nvm alias default 8
nvm use 8 That could even address other comments in this issue: https://stackoverflow.com/a/24587177/6091685 |
The deal is that many things need to be in sync on the same node.js version. They can be out of sync when you have a default node version, create a Rails project, and then switch to a different version, for example, via
|
|
Add node_modules to dockerignore to ensure that local dependencies won't overwrite yarn installed dependencies Ref: rails/webpacker#1374 (comment)
Add node_modules to dockerignore to ensure that local dependencies won't overwrite yarn installed dependencies Ref: rails/webpacker#1374 (comment)
|
I'm using I try a lot of solution above, for examples: yarn --update-checksums
yarn install --check-files
yarn install
rm -rf node_module && yarn install But it doesn't work This is how I solved the problem: rm -rf yarn.lock
yarn install |
Update on my issue. I had installed yarn first from apt-get, and then installed nvm. This resulted in webpacker not using the nvm version. |
please check webpacker.yml i have found that i wrote check_yarn_integrity twice and one of the was true after removing that the issue get fixed |
I have the same issue and I solved this by uninstalling yarn 2 and reverting back to yarn 1 |
see this issue for more details rails/webpacker#1374
Thank you @bary822 , restarting the terminal also helped me. |
I've had this happen quote a bit in a docker environment where I had node_modules in docker volume. For me the solution was to delete node_modules docker volume. Sharing for info. |
I believe Webpacker is using the |
In my case I had to downgrade from node version Error Log
|
Not to be that guy... but where did that |
just updated to 3.4.0 and I get this:
If I run it manually, everything is fine:
If I use
NODE_ENV=production
I can reproduce it:If I install with production ...
... I can use rails again and the rails integrity check works. But of course I want to use my development yarn packages, so this is no solution.
The problems seems to be that
yarn check --integrity
is run withNODE_ENV=producion
, even locally when developing.The text was updated successfully, but these errors were encountered: