[codex] Improve missing Suspense flag diagnostic#8660
Conversation
|
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
wmertens
left a comment
There was a problem hiding this comment.
This adds another full code scan on every transform, while I think it could instead be done in the Suspense component when trying to use it?
|
I think @Varixo said there was a better error in his branch |
Summary
Adds an early Qwik Vite transform diagnostic when a module imports
Suspensefrom@qwik.dev/corebut the app has not enabledqwikVite({ experimental: ['suspense'] }).The new error tells the developer exactly which Vite config flag is missing and includes the file path that triggered the check.
Problem
Without the
suspenseexperimental flag, async UI that depends on Suspense coordination can fail in a confusing way during SSR. In practice this can look like a stalled SSR request or an unrelated optimizer/runtime symptom, which sends developers looking in the wrong place.The existing runtime error is useful when the
Suspensecomponent function actually runs, but it is too late for some dev-server paths. Catching the import during transform gives a direct configuration error before the app gets into an opaque async render state.Changes
Suspenseimport without the experimental flag.Validation
pnpm build.corepnpm vitest --run packages/qwik-vite/src/plugins/plugin.unit.ts