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

fix: don't watch SPA fallback paths #14953

Merged
merged 1 commit into from
Nov 12, 2023

Conversation

sapphi-red
Copy link
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-dev patak-dev merged commit 24c2c57 into vitejs:main Nov 12, 2023
10 checks passed
@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