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

to svelte4 #5

Merged
merged 1 commit into from
Jun 25, 2023
Merged

to svelte4 #5

merged 1 commit into from
Jun 25, 2023

Conversation

asukaminato0721
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jun 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
luoxu-web ❌ Failed (Inspect) Jun 25, 2023 8:16am

@lilydjwg
Copy link
Owner

Can you figure out how to use newer version of nodejs on Vercel?

@lilydjwg
Copy link
Owner

OK, I've figured it out.

@lilydjwg lilydjwg merged commit 4de8606 into lilydjwg:master Jun 25, 2023
2 checks passed
@lilydjwg
Copy link
Owner

It doesn't load correctly. I've rollbacked the deployment.

@lilydjwg
Copy link
Owner

onMount isn't called after this change. Can you figure out a fix?

@asukaminato0721
Copy link
Contributor Author

asukaminato0721 commented Jun 26, 2023

onMount isn't called after this change. Can you figure out a fix?

I guess this: https://svelte.dev/docs/v4-migration-guide#stricter-types-for-svelte-functions

onMount now shows a type error if you return a function asynchronously from it, because this is likely a bug in your code where you expect the callback to be called on destroy, which it will only do for synchronously returned functions

but as this sveltejs/svelte#8136 said, it only has a relationship to return async

@asukaminato0721
Copy link
Contributor Author

I am not sure if the below code works.

  onMount(() => {
    do_hash_search();
    while (true) {
      try {
        fetch(`${LUOXU_URL}/groups`)
          .then((res) => res.json())
          .then((json) => {
            groups = json.groups;
            need_update_title = true;
          });
        if (!group) {
          group = "";
        }
        break;
      } catch (e) {
        console.error("failed to fetch group info, will retry", e);
        sleep(1000).then(() => {});
      }
    }
  });

@lilydjwg
Copy link
Owner

There is no error, and there is no function returned.

@asukaminato0721
Copy link
Contributor Author

asukaminato0721 commented Jun 26, 2023

is there a minimal example to test locally? Or maybe propose an issue to Svelte .

@lilydjwg
Copy link
Owner

Not yet. You can try to create one.

@lilydjwg
Copy link
Owner

I've reverted this. I'll try again after the issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants