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

Embeds only start with /projects or /documents #1020

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

eyeseast
Copy link
Collaborator

SvelteKit is serving 404 pages to missing static files and other things that it shouldn't. This should save us some bandwidth, at least.

Example: https://embed.documentcloud.org/_app/immutable/chunks/navigation.CziXxwWJ.js (may need a hard refresh if your browser cached it).

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for documentcloud-frontend-next ready!

Name Link
🔨 Latest commit 00fd8e0
🔍 Latest deploy log https://app.netlify.com/sites/documentcloud-frontend-next/deploys/678acedf79105a0008a7f3c6
😎 Deploy Preview https://deploy-preview-1020.muckcloud.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 20 (🔴 down 39 from production)
Accessibility: 87 (🟢 up 1 from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 83 (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.

Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 31.82% 7679 / 24126
🔵 Statements 31.82% 7679 / 24126
🔵 Functions 47.47% 339 / 714
🔵 Branches 75.54% 1115 / 1476
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/utils/embed.ts 85.97% 96.55% 71.42% 85.97% 96-97, 313-326, 329-356
src/lib/utils/tests/embed.test.ts 100% 100% 100% 100%
Generated in workflow #585 for commit 00fd8e0 by the Vitest Coverage Report Action

@mitchelljkotler
Copy link
Member

What should it be doing? Why are there missing static files?

@eyeseast
Copy link
Collaborator Author

eyeseast commented Jan 17, 2025

If there's a missing static file, it should just 404 with a plain text Not found. Here's an example: https://www.documentcloud.org/_app/immutable/assets/36.DNyy9aEA.css (hard refresh if you get CSS). It's a file from an older deploy. If my browser has cached an HTML page that requests that file, it should just 404, ideally served by Netlify. But if our router catches it, SvelteKit serves a 404.

Our embed rerouting was seeing the embed subdomain and trying to render a route at /embed/_app/immutable/assets/36.DNyy9aEA.css. Now it won't do that.

@eyeseast eyeseast merged commit 9a05ba0 into main Jan 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants