Skip to content
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

gatsby develop falsly detects incomplete cache #27641

Closed
BitPatty opened this issue Oct 24, 2020 · 2 comments · Fixed by #27682
Closed

gatsby develop falsly detects incomplete cache #27641

BitPatty opened this issue Oct 24, 2020 · 2 comments · Fixed by #27682
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@BitPatty
Copy link

BitPatty commented Oct 24, 2020

Description

This issue appeared sometime after version 2.24.79

I'm currently using the following scripts to remove the .cache and public directory before running/building gatsby:

    "build": "rimraf .cache && rimraf public && gatsby build",
    "develop": "rimraf .cache && rimraf public && gatsby develop",

On the latest version 2.24.85 it logs that there is a .cache directory when running yarn develop, even though there hasn't been one:

success open and validate gatsby-configs - 0.009s
success load plugins - 0.025s
success onPreInit - 0.019s
info We've detected that the Gatsby cache is incomplete (the .cache directory exists
but the public directory does not). As a precaution, we're deleting your site's
cache to ensure there's no stale data.

Steps to reproduce

  1. Install rimraf
  2. Replace the develop/build script with
    "build": "rimraf .cache && rimraf public && gatsby build",
    "develop": "rimraf .cache && rimraf public && gatsby develop",
  1. Run yarn develop

Repository: https://github.com/BitPatty/gatsby-issue-27641

Expected result

Gatsby doesn't detect the .cache directory, since it doesn't exist.

Actual result

Gatsby detects a .cache directory.

Environment

  System:
    OS: Linux 4.19 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (6) x64 Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 12.19.0 - ~/.nvm/versions/node/v12.19.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v12.19.0/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.19.0/bin/npm
  Languages:
    Python: 2.7.17 - /usr/bin/python
  npmPackages:
    gatsby: 2.24.85 => 2.24.85
    gatsby-image: 2.4.21 => 2.4.21
    gatsby-plugin-manifest: 2.4.35 => 2.4.35
    gatsby-plugin-offline: 3.2.37 => 3.2.37
    gatsby-plugin-react-helmet: 3.3.14 => 3.3.14
    gatsby-plugin-react-svg: 3.0.0 => 3.0.0
    gatsby-plugin-sharp: 2.6.43 => 2.6.43
    gatsby-source-filesystem: 2.3.35 => 2.3.35
    gatsby-source-graphql: 2.7.6 => 2.7.6
    gatsby-transformer-sharp: 2.5.19 => 2.5.19
@BitPatty BitPatty added the type: bug An issue or pull request relating to a bug in Gatsby label Oct 24, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 24, 2020
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 26, 2020
@vladar vladar self-assigned this Oct 26, 2020
@vladar
Copy link
Contributor

vladar commented Oct 26, 2020

Thanks for reporting this @BitPatty !

Looks like it happens only in develop. Doesn't see this with build. Can you confirm?

P.S. yarn.lock in your repro has all the packages installed from a custom npm repository, I had to remove yarn.lock to use it.

@BitPatty
Copy link
Author

Looks like it happens only in develop. Doesn't see this with build. Can you confirm?

Yes

yarn.lock in your repro has all the packages installed from a custom npm repository, I had to remove yarn.lock to use it.

oops, my bad :) Updated the lockfile!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants