We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fe8566a + 7d62aa2 commit 246b4e4Copy full SHA for 246b4e4
.changeset/kind-yaks-rule.md
@@ -0,0 +1,5 @@
1
+---
2
+'@builder.io/qwik': patch
3
4
+
5
+fix: useResource's onRejected now catches errors again; preventing unhandled errors in test environments.
packages/qwik/src/core/use/use-resource.ts
@@ -263,6 +263,7 @@ function getResourceValueAsPromise<T>(props: ResourceProps<T>): Promise<JSXOutpu
263
const isBrowser = !isServerPlatform();
264
if (isBrowser) {
265
if (props.onRejected) {
266
+ resource.value.catch(() => {});
267
if (resource._state === 'rejected') {
268
return Promise.resolve(resource._error!).then(useBindInvokeContext(props.onRejected));
269
}
0 commit comments