fix(apps): surface autoconfigApps configure failures instead of swallowing#338
Open
hugo-ccabral wants to merge 1 commit into
Open
fix(apps): surface autoconfigApps configure failures instead of swallowing#338hugo-ccabral wants to merge 1 commit into
hugo-ccabral wants to merge 1 commit into
Conversation
…owing
configureAllApps caught every per-app error with an empty `catch {}`. When an
app matched a decofile block but failed to configure — most insidiously a
registry entry's `module: () => import("./mod")` dynamic import that resolves
under `vite dev` but NOT in a production bundle — the app was skipped silently,
its loaders/actions never registered, and its (often deferred) sections
resolved to null at runtime with zero diagnostic. Log the error (keep skipping
so one bad app can't break setup). This would have made a multi-hour
storefront-tanstack "PDP shows nothing in prod" investigation a one-line log.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
configureAllApps(autoconfigApps) wrapped each app's configure in an emptycatch {}. When an app is present in the decofile but fails to configure, it's skipped silently — its loaders/actions never register, and its sections resolve tonullat runtime with no log.The insidious case (hit on storefront-tanstack): a registry entry's
module: () => import("./mod")dynamic import resolves undervite devbut not in the production vite/workerd bundle. Result: Shopify skipped in prod only → PDP renders "Page not found" in prod, works in dev, no error anywhere. It took a full prod-build + headless-browser investigation to find; thisconsole.errorwould have surfaced it immediately.Change
Log the caught error (app blockKey + the error), still skip the app so one broken app can't take down setup. No behavior change beyond the log.
Follow-up (not in this PR)
The underlying cause —
apps-*registry entries using a dynamicimport("./mod")that doesn't survive production bundling — is worth fixing at the source (static/eager module reference in each app'sregistry.ts). Sites can work around it today with{ ...APP_REGISTRY_ENTRY, module: async () => staticMod }.🤖 Generated with Claude Code
Summary by cubic
Log configuration failures in
autoconfigAppsinstead of swallowing them, so misconfigured apps don’t fail silently and cause null sections in production. Failing apps are still skipped to keep setup stable.blockKeywhen configure/module load fails; continue skipping the app.module: () => import("./mod")works invite devbut fails in production bundles.Written for commit 7c8e322. Summary will update on new commits.