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

Vim's swap file breaks refresh of MDX documents #38276

Open
2 tasks done
jgosmann opened this issue Jun 30, 2023 · 0 comments
Open
2 tasks done

Vim's swap file breaks refresh of MDX documents #38276

jgosmann opened this issue Jun 30, 2023 · 0 comments
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby

Comments

@jgosmann
Copy link
Contributor

Preliminary Checks

Description

I'm using gatsby-plugin-mdx to create pages from MDX files. If I run Gatsby in development mode and edit one of those files with Vim (and active swapfile option), the refresh of the page in the browser breaks, i.e. the content is not updated. A hard refresh does not help either. Closing Vim and removing the swap file does not solve the issue; one has to restart gatsby develop to see updates again.

Using different editors or deactivating the swap file, the refresh works as expected (if it was not broken beforehand by using Vim).

Reproduction Link

https://github.com/jgosmann/gatsby-mdx-broken-refresh

Steps to Reproduce

  1. Run Gatsby in development mode: npx gatsby develop
  2. Open http://localhost:8000/main in your browser
  3. Open this file with Vim: vim src/content/main.mdx
  4. Ensure the swap file is active: :set swapfile
  5. Edit this file and save it.
  6. Observe that (despite Gatsby output in the terminal) the page in the browser won't update. (Maybe it will still on the first saved edit, but after the second edit it should no longer.)
  7. Closing Vim (and thus removing the swap file), won't restore the update. Even when using a different editor, the page won't update.

Expected Result

Even when editing with Vim (and when a swap file is created), the page refreshes with the new content in the development mode.

Actual Result

The page does not refresh with new content.

Environment

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Shell: 5.9 - /opt/local/bin/zsh
  Binaries:
    Node: 20.2.0 - /opt/local/bin/node
    Yarn: 1.22.19 - /opt/local/bin/yarn
    npm: 9.7.1 - /opt/local/bin/npm
  Languages:
    Python: 3.11.3 - /opt/local/bin/python
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 16.5.1
  npmPackages:
    gatsby: ^5.12.0-next.0 => 5.12.0-next.0
    gatsby-plugin-mdx: ^5.11.0 => 5.11.0
    gatsby-source-filesystem: ^5.11.0 => 5.11.0
  npmGlobalPackages:
    gatsby-cli: 3.5.0

Config Flags

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Shell: 5.9 - /opt/local/bin/zsh
  Binaries:
    Node: 20.2.0 - /opt/local/bin/node
    Yarn: 1.22.19 - /opt/local/bin/yarn
    npm: 9.7.1 - /opt/local/bin/npm
  Languages:
    Python: 3.11.3 - /opt/local/bin/python
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 16.5.1
  npmPackages:
    gatsby: ^5.12.0-next.0 => 5.12.0-next.0
    gatsby-plugin-mdx: ^5.11.0 => 5.11.0
    gatsby-source-filesystem: ^5.11.0 => 5.11.0
  npmGlobalPackages:
    gatsby-cli: 3.5.0
@jgosmann jgosmann added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 30, 2023
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

1 participant