-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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: avoid suppressing errors when loading pages for ssr fails #8813
Conversation
🦋 Changeset detectedLatest commit: 4889c81 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!! fyi, it looks like this needs a rebase
/** @param {string} id */ | ||
async function resolve(id) { | ||
const url = id.startsWith('..') ? `/@fs${path.posix.resolve(id)}` : `/${id}`; | ||
|
||
const module = await vite.ssrLoadModule(url); | ||
let module = await vite.ssrLoadModule(url).catch((error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, this is fantastic! I didn't know about buildErrorMessage
I see another half dozen places where ssrLoadModule
is called. Maybe we also need this same code in those places? We could make a utility function that calls ssrLoadModule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulling that rebase commit back to my local took me way longer than it should have, hah.
I'll look at the other locations tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it to the other 2 places where we're loading user modules,
for the ones generated by Kit, there's already a generic error page with the stack trace that's rendered, probably don't need it there.
af23f73
to
60ffe18
Compare
huge improvement! |
@@ -50,11 +50,25 @@ export async function dev(vite, vite_config, svelte_config) { | |||
/** @type {Error | null} */ | |||
let manifest_error = null; | |||
|
|||
/** @param {string} url */ | |||
async function loud_ssr_load_module(url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loud. Lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought it was a typo for load, but then I just noticed load is in the name later on, so maybe it's not a typo 🤣
closes #8799
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.