Skip to content

Escape paths passed to optimizeDeps.entries #13570

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

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented May 9, 2025

The values passed to optimizeDeps.entries are expected to be tinyglobby patterns, not file paths. We're currently passing file paths which means that any special matching characters in file names will accidentally trigger pattern matching.

To fix this, we now pass all paths through escapePath.

In terms of versioning, I've ensured we depend on the same tinyglobby version range as Vite: https://github.com/vitejs/vite/blob/main/packages/vite/package.json#L93

Note that in Vite v5, the globs are passed to fast-glob instead of tinyglobby, but since tinyglobby is a drop-in replacement, we don't need to do any version detection.

Copy link

changeset-bot bot commented May 9, 2025

🦋 Changeset detected

Latest commit: d050831

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@react-router/dev Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch
react-router Patch
react-router-dom Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@markdalgleish markdalgleish marked this pull request as draft May 12, 2025 00:16
@markdalgleish
Copy link
Member Author

This PR was opened to address an issue raised in Discord, but it looks like it might be an underlying Vite issue. I'm marking this as draft for now until we track down what the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant