Skip to content

Commit 0142532

Browse files
committed
fix: use-resource not catching onRejected
1 parent fe8566a commit 0142532

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/qwik/src/core/use/use-resource.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ function getResourceValueAsPromise<T>(props: ResourceProps<T>): Promise<JSXOutpu
263263
const isBrowser = !isServerPlatform();
264264
if (isBrowser) {
265265
if (props.onRejected) {
266+
resource.value.catch(() => {});
266267
if (resource._state === 'rejected') {
267268
return Promise.resolve(resource._error!).then(useBindInvokeContext(props.onRejected));
268269
}

0 commit comments

Comments
 (0)