-
Notifications
You must be signed in to change notification settings - Fork 116
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
documentReady function triggers start before configuring ahoy #56
Comments
Hi, also having this problem, pretty silly that the library boots and ignores its own config options. Currently debugging even more issues. I fixed it by changing the default startOnReady to be false in the local file. Not sure what the best fix is here to keep that automatic booting but also allow people to switch functionality on/off. |
Hey @jcamejo and @nabilfreeman, which version of Ahoy.js are you on? This should be addressed in #45. |
Hi @ankane the version was 0.3.7. I will check the issue again by updating the library and let you know if this is still a problem. Sorry for the delayed answer |
Thanks for the fix!! We are still using Ahoy and finding it very useful 🥳 |
Hi! first of all thanks for this useful tool.
I was having some troubles finding out why on the first page load, visitsUrl was pointing to the default URL 'ahoy/visits' and not the one I set up with the configure method. I find out that the issue is related to the documentReady function call at the end of library source code.
The problem is synchronization, by the time the library module is required, is very likely that the DOM content has already been loaded, calling the documentReady function with the default parameters that are inside the library source code (where startOnReady. is set to true, mine is set to false). Due to some requirements I'm using require.js that is being loaded after the HTML body tag and it's difficult for me to change this.
I writing this issue also as a reminder, I will like to make a pull request offering an alternative solution when i have some time. I can just change the default config object, but it would be better if it supports my use case.
Let me know what you think or if there's another step or solution that I'm missing.
Thanks!
The text was updated successfully, but these errors were encountered: