Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource internal error #6912

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-plants-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': minor
---

it occurs a internal error when page is useResource$ module
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ export default component$(() => {
count: number;
}>(async ({ track, cleanup }) => {
track(() => name.value);
const abortController = new AbortController();
cleanup(() => abortController.abort('cleanup'));
const controller = new AbortController();
cleanup(() => controller.abort());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what the problem is - is it because of the 'cleanup' string?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these changes actually fix the issue as they are not related to the demo that fails.

Have a look at this PR instead: #6893.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what the problem is - is it because of the 'cleanup' string?

Yes because of the ‘cleanup’ string. It's weird but I'm still digging into it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these changes actually fix the issue as they are not related to the demo that fails.

Have a look at this PR instead: #6893.

You can try it by my code if you don't believe that can fix it.
And I have already shown my picture that everything is ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue doesn't occur locally, that's why the screenshots show that everything is ok.

Everything works locally even with the clean up string passed to the abort controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, my bad.
I will close this PR.

const res = await fetch(`https://api.agify.io?name=${name.value}`, {
signal: abortController.signal,
signal: controller.signal,
});
return res.json();
});
Expand Down