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

Initialize checks for unused ".cache/json" directory before deleting all HTML and CSS #33262

Closed
2 tasks done
ascorbic opened this issue Sep 20, 2021 · 0 comments · Fixed by #33431
Closed
2 tasks done
Labels
help wanted Issue with a clear description that the community can help with. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@ascorbic
Copy link
Contributor

Preliminary Checks

Description

The initialize function checks for the existence of .cache/json, and if it doesn't exist then deletes all existing HTML and CSS files. This directory is unused when using lmdb-store. This means that if no pages have changed then all the pages on the site are deleted.

There are several issues that I can see here:

  1. initialize is checking for a folder that isn't used anymore
  2. initialize doesn't check if lmdb data store is missing
  3. missing pages aren't regenerated

Reproduction Link

https://github.com/ascorbic/cache-json-bug

Steps to Reproduce

  1. Clone repo (or just start with any Gatsby 4 repo)
  2. Run gatsby build
  3. Delete empty .cache/json directory
  4. Run gatsby build again

Expected Result

public/index.html should exist

Actual Result

All HTML and CSS files are deleted and no re-created

Environment

System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.5.0 - ~/.nvm/versions/node/v16.5.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.19.1 - ~/.nvm/versions/node/v16.5.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 93.0.4577.82
    Safari: 14.1.1
  npmPackages:
    gatsby: ^4.0.0-zz-next.1 => 4.0.0-zz-next.1

Config Flags

No response

@ascorbic ascorbic added the type: bug An issue or pull request relating to a bug in Gatsby label Sep 20, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 20, 2021
@graysonhicks graysonhicks added gatsby 4 help wanted Issue with a clear description that the community can help with. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. 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.

2 participants