-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Pages not deleted on node update/delete #10844
Comments
Thank you for opening this @rexxars
Just so I understand correctly, when you say the page is not removed, you mean the assets still exist in |
The expected result is that The repository I linked to should illustrate this problem quite easily. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
I believe I'm running into the same issue. When trying to exclude draft posts from the production build with exports.onCreateNode = ({ node, actions }) => {
if (
process.env.NODE_ENV === `production` &&
node.frontmatter &&
node.frontmatter.draft
) {
actions.deleteNode({ node })
}
}
|
@janosh This is different issue. Issues listed here don't result in actual hard crashes and focus mainly on stateful source plugins that create, modify and delete nodes outside of Even if Your example didn't crash - we will probably restrict usage of it (deleting nodes that other plugins created). Better way would be to adjust your queries to filter out draft nodes from results. |
Oh I see. Sorry for the confusion. I tried filtering out draft nodes at first but I don't think that's a better idea. It turned out to be quite the hassle. I first had to modify |
I'm not sure if what I'm running into is the same issue or not but it may be. So now I'm attempting to manually delete the page in Is there currently a way to manage this manually to get around the bug? Edit: To add to my comment above, if I manually go into You can see this bug using |
I believe that the problem here occurs in the query-runner module. In that module, a call is made to the store to retrieve the page that needs to be modified, and that page is then fed into the
If the page has been deleted, the |
Any update here? My case is using Gatsby theme https://github.com/gatsbyjs/themes/tree/master/packages/gatsby-theme-blog-core I can not change the theme |
Experiencing the same issue with Gatsby connected to Contentful. The html file is deleted but not the page-data json, so any 404 that shows get quickly replaced via what @GKJCJG said. Any update would be appreciated. |
Closing this as stale since in the meantime Gatsby v3 and updated related packages were released. Please try with the latest versions and if you still see this problem open a new bug report (it must include a minimal reproduction). |
Having this problem. May I ask what did you end up doing? @janosh |
Description
When pages are created from nodes, and you use the
createPageDependency()
action to declare a dependency on the node, when the node is deleted (after the first build), no page rebuilding is triggered. The change is visible once something else triggers a page rebuild, but the page is not removed.A similar thing happens when you update a node which causes a new page to be built: the node is updated, but the page building fails with this error:
Steps to reproduce
I've create a sample repo where you can easily reproduce both bugs. See https://github.com/rexxars/gatsby-node-update-bugs
Expected result
I had expected that the page would be marked as dirty and thus removed. In the case of the updated node, I would have expected the new page to work as intended, while the old page would be removed.
Actual result
As outlined in the description, the pages never seem to be removed, and new pages builds with errors.
Environment
The text was updated successfully, but these errors were encountered: