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

The event is invalid after upgrading the version. #43

Closed
fxjs opened this issue Jun 23, 2022 · 10 comments
Closed

The event is invalid after upgrading the version. #43

fxjs opened this issue Jun 23, 2022 · 10 comments
Labels

Comments

@fxjs
Copy link

fxjs commented Jun 23, 2022

When upgrading from 1.9.0 to 1.11.1, all event broadcasts seem to be unresponsive. What is the reason?

@jcubic
Copy link
Owner

jcubic commented Jun 23, 2022

Can you share your code? Maybe you have an online demo?

Without seeing your code nothing I can do to help.

@jcubic
Copy link
Owner

jcubic commented Jun 28, 2022

Just noticed that the library doesn't work on CodeSandbox anymore because of added 'load' event. It's great that you've reported a bug but it's not helpful if you don't reply.

@jcubic jcubic added the bug label Jun 28, 2022
jcubic added a commit that referenced this issue Jun 29, 2022
@jcubic
Copy link
Owner

jcubic commented Jun 29, 2022

It should be fixed, but I'm not 100% sure if this is the error you have.

@jcubic
Copy link
Owner

jcubic commented Jul 15, 2022

I'm closing this because I didn't get a reply and it seems to be fixed on CodeSandbox.

@jcubic jcubic closed this as completed Jul 15, 2022
@fxjs
Copy link
Author

fxjs commented Aug 20, 2022

sysend-not_working-issue.zip
I'm sorry to keep you waiting so long.
Here is the minimal vite project that reproduces the problem (npm i && npm run dev).
Looking forward to your reply, thank you.

@jcubic

@jcubic
Copy link
Owner

jcubic commented Aug 20, 2022

Thanks for the code. I've added consoe.log before .on and .broadcast. and the second one is not executed maybe you made mistake in your Vue.js code.

onMounted(() => {
  console.log("sysend.broadcast('form_loaded')");
  sysend.broadcast('form_loaded')
})

@fxjs
Copy link
Author

fxjs commented Aug 21, 2022

Thanks for the code. I've added consoe.log before .on and .broadcast. and the second one is not executed maybe you made mistake in your Vue.js code.

onMounted(() => {
  console.log("sysend.broadcast('form_loaded')");
  sysend.broadcast('form_loaded')
})

Thanks for the reply,
onMounted is the built-in hook of Vue.
sysend@1.9.0 version is OK.

@jcubic
Copy link
Owner

jcubic commented Aug 21, 2022

But the log is not executed, I don't see my message in the console.

@jcubic jcubic reopened this Aug 21, 2022
@jcubic
Copy link
Owner

jcubic commented Aug 21, 2022

I was able to reproduce the issue. The log was triggered but the page was inside a new window.

The problem was that there the document can be in two states: interactive and complete. But the library was running initialization only on complete and ignored interactive state, where load even was already fired. You can read it on MDN.

jcubic added a commit that referenced this issue Aug 21, 2022
Fix initalization of the library when load event already fired.
@jcubic
Copy link
Owner

jcubic commented Aug 21, 2022

Fixed in version 1.12.3

@jcubic jcubic closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants