-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
1.4 Broke rewrites #4261
Comments
path-to-regexp had a vulnerability. Their fix broke your rewrite patterns somehow - pillarjs/path-to-regexp#324 This likely won't be fixed at source as it's a vulnerability patch not exactly a regression. You can use pnpm.overrides to lock it to ~6.2 (not recommended in long term). Or update your pattern to work with newer versions. |
I had a similar problem. I had this rewrites config rewrites: {
'posts/:skipped/:year-:month-:day-:slug.md': ':year/:month/:day/:slug/index.md',
} and now It was once rewrited as Edit: changing the pattern to |
I'm not sure this library is the best match for Vitepress. The security issue in question is not relevant for a static site generator is it? May I ask that you add the option for a function to be passed to rewrite paths? I've already struggled to use the existing approach and not sure how to fix it now. The version Vitepress uses is not the latest, its docs are not what's currently on the latest readme but rather I have to find older commits. All of this for me is just extra work versus having a function I could just implement what I want. Would that be doable or does the currently declarative approach have deeply dependent internals? |
Yeah we can support passing a function 👀 |
Will be out in next version. |
@brc-dd thanks that's great to hear! Looking forward to it. |
Released. Should I close this issue? I don't think we can do much about path-to-regexp breaking edge cases from vitepress' side. And I also updated the docs to link to it's v6 version. We won't update it to v8 till our next major 👀 |
Yep sounds good let's close! |
Describe the bug
I use these rewrites in my Vitepress config:
Reproduction
I have a failing case right now on this PR, example build failure: https://github.com/jasonkuhrt/graffle/actions/runs/11219992004/job/31187185529?pr=1168.
Expected behavior
I expected that a minor release of Vitepress would not break the config.
System Info
The text was updated successfully, but these errors were encountered: