I have a basic blog setup using gatsbyjs with support for .md and .mdx markdown files for blogging. When I delete a markdown file, the site throws an error and stops.
I go to the blog folder in the site root / and delete a random .mdx or .md file.
What should happen?
I expect to see the blog removed from the main blog list on the home page of the gatsby site.
What happened.
It resulted in the site stopping and throwing an error on the site page as follows.
Run gatsby info --clipboard in your project directory and paste the output here.
System:
OS: Windows 7
CPU: (4) x64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz
Binaries:
npm: 6.9.0 - C:Program Filesnodejsnpm.CMD
Languages:
Python: 2.7.15 - /c/Users/SmartTechies/.windows-build-tools/python27/python
npmPackages:
gatsby: ^2.13.50 => 2.13.67
gatsby-image: ^2.2.8 => 2.2.8
gatsby-plugin-manifest: ^2.2.5 => 2.2.5
gatsby-plugin-mdx: ^1.0.0 => 1.0.24
gatsby-plugin-offline: ^2.2.4 => 2.2.6
gatsby-plugin-react-helmet: ^3.1.3 => 3.1.3
gatsby-plugin-sharp: ^2.2.9 => 2.2.12
gatsby-remark-images: ^3.1.12 => 3.1.12
gatsby-source-filesystem: ^2.1.8 => 2.1.9
gatsby-transformer-mdx: ^1.1.2 => 1.1.2
gatsby-transformer-remark: ^2.6.14 => 2.6.14
gatsby-transformer-sharp: ^2.2.5 => 2.2.6
what happens when you restart it?
@nguyenami when I restart, it is fine. I mean the Blog Main Site comes up as expected and the blog entry that I deleted does not show up anymore.
But I was hoping to be able to remove a blog entry that I no longer need, it should not mess up a running site?
@KyleAMathews any pointers would be highly helpful. Does content add and delete of .mdx and .md files be not dynamic? With a hot reload?
I think this happens with any file you delete while the development server is running, so it is not just MDX related
@PsychedMagnet so is that the expected behavior? Don't you think adding and removing of markdown or any similar file is a basic need wherein content is added or removed? Is there a fix being discussed so that such errors do not throw up?
Please let me know.
@jnsrikanth No, I don't think it is expected behavior. I am just pointing it out for anyone who may know more about this.
Now that I think about it, the same happened when I used create-react-app, so it may be a webpack issue.
@KyleAMathews this is a serious issue as this is hampering leveraging gatsby local blog capabilities (without a headless CMS API etc.) using powerful features such as MDX wherein a small change in the markdown file or adding, removing of MDX files is causing the entire site restart...If this is a bug or a webpack issue as pointed out above by @PsychedMagnet , please let us know of a fix. If it is not a feature yet, we need this supported as we plan to have hundreds of blog files (.mdx or .md) being added/removed/modified and maintained, and that should not ever lead to a site restart? Where is the whole Hot Reloading thing? Am I missing something? This issue has been pending for way too long and I have not had much success on Stackoverflow either.
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鈥檚 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!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 馃挭馃挏