Skip to content

fix: don't watch SPA fallback paths#14953

Merged
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/dont-watch-spa-fallback-paths
Nov 12, 2023
Merged

fix: don't watch SPA fallback paths#14953
patak-cat merged 1 commit intovitejs:mainfrom
sapphi-red:fix/dont-watch-spa-fallback-paths

Conversation

@sapphi-red
Copy link
Copy Markdown
Member

Description

This PR fixes the CI fail in vuejs/vitepress#3200.
https://discord.com/channels/804011606160703521/831456449632534538/1172931790554546368

The reason why it was failing with ELOOP: too many symbolic links encountered, stat '/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/gems/mechanize-2.9.1/mechanize-2.9.1' since beta.17 is because

  • fix: add watch in fallback file load #14938 added ensureWatchedFile(watcher, id, root) after no plugin's load hook handled that id
  • /home was passed to that because accessing /home goes through the plugin pipeline (
    // if this is an html request and there is no load result, skip ahead to
    // SPA fallback.
    if (options.html && !id.endsWith('.html')) {
    return null
    }
    )
  • ensureWatchedFile has fs.existsSync(file), but /home is true even though that is not a file

I moved the ensureWatchedFile after if (options.html && !id.endsWith('.html')). Instead, I can move some code from loadAndTransform to the plugin container, but I think it's safer to avoid that.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added the p3-minor-bug An edge case that only affects very specific usage (priority) label Nov 12, 2023
@sapphi-red sapphi-red added this to the 5.0 milestone Nov 12, 2023
@sapphi-red sapphi-red added the regression The issue only appears after a new release label Nov 12, 2023
@patak-cat patak-cat merged commit 24c2c57 into vitejs:main Nov 12, 2023
@sapphi-red sapphi-red deleted the fix/dont-watch-spa-fallback-paths branch November 12, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority) regression The issue only appears after a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants