You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduced in Qwik V2, the error Promises not expected here. is thrown when rendering a component with a conditional projection that is async.
For example:
// File: src/routes/index.tsxexportdefaultcomponent$(()=>{constopen=useSignal(false);return(<TheCursedRevealopen={open.value}>{t("I am an async string")}</TheCursedReveal>);});constTheCursedReveal=component$<{open: boolean;}>(({ open })=>{return<>{open&&<Slot/>}</>;});asyncfunctiont(key: string): Promise<string>{returnPromise.resolve(key);}
Any other variants of a <Slot /> being conditionally rendered will give the same error. For example:
constTheOtherCursedReveal=component$<{open: boolean;}>(({ open })=>{if(!open)returnnull;return(<div><Slot/></div>);});
Additionally, the error is so obscure that it doesn't help at all to understand where and why this error is triggered:
QWIK ERROR Promises not expected here. Error: Promises not expected here.
at createAndLogError (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:53:52)
at throwErrorAndStop (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:28:17)
at drain (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:3202:20)
at Module._walkJSX (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:3226:3)
at SSRContainer.emitUnclaimedProjection (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/server.mjs:8721:35)
at SSRContainer.emitContainerData (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/server.mjs:8414:10)
at SSRContainer.closeElement (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/server.mjs:8239:24)
at drain (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:3207:31)
at resolveValue (/home/ian/Projects/noma/node_modules/.pnpm/@builder.io+qwik@file+..+oss+qwik+packages+qwik_prettier@3.3.3_vite@5.4.9_@types+node@22.7.7__3o4nugbb2q2oqnvka6jhcm2faq/node_modules/@builder.io/qwik/dist/core.mjs:3189:5)
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
Which component is affected?
Qwik Runtime
Describe the bug
Introduced in Qwik V2, the error
Promises not expected here.
is thrown when rendering a component with a conditional projection that is async.For example:
Any other variants of a
<Slot />
being conditionally rendered will give the same error. For example:Additionally, the error is so obscure that it doesn't help at all to understand where and why this error is triggered:
Additional Information
Debugging:
The text was updated successfully, but these errors were encountered: