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 issue with rewriting #2904

Merged
merged 3 commits into from
Feb 19, 2025
Merged

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Feb 19, 2025

Description

This PR fixes an issue with rewriting, e.g. in a middleware using context.rewrite(), which would cause the following error:

Cannot redefine property: starlightRoute

This is due to the fact that the property is not configurable and rewriting causes any middleware to be re-executed, which would try to redefine the property.

This will trigger a new rendering phase, causing any middleware to be re-executed.

Copy link

changeset-bot bot commented Feb 19, 2025

🦋 Changeset detected

Latest commit: eb39529

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

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight 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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Feb 19, 2025
Copy link

netlify bot commented Feb 19, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit eb39529
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/67b6646d7fb7d00008256266
😎 Deploy Preview https://deploy-preview-2904--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@delucis delucis added the 🌟 patch Change that triggers a patch release label Feb 19, 2025
@delucis delucis merged commit ec5ca59 into withastro:main Feb 19, 2025
15 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Feb 19, 2025
@ringods
Copy link

ringods commented Feb 24, 2025

@HiDeoo @delucis I'm on 0.32.1 but still see this error:

 generating static routes
10:33:16 ▶ @astrojs/starlight/routes/static/404.astro
10:33:16   └─ /404.htmlEntry docs → 404 was not found.
Cannot read properties of undefined (reading 'find')

Didn't have this on 0.30.3. Is this still related or should I file a new issue?

@delucis
Copy link
Member

delucis commented Feb 24, 2025

Hey @ringods — that sounds like a different error. A new issue with a minimal reproduction would be great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

context.rewrite broken in starlight 0.32.0
3 participants