You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to integrate the x-sort plugin into my application, but I’ve encountered a few issues related to the loading order of Alpine.js.
When Alpine.js is loaded before the body is parsed, I receive a warning in the console suggesting that I should defer the loading of Alpine.js until after the body is fully parsed. However, according to the documentation for the x-sort plugin here, the plugin does not work unless it is loaded before the entire page is rendered. This indicates that deferring the script loading will not yield immediate results, whereas removing the defer keyword allows the sorting functionality to work as expected.
Additionally, I observed similar behavior when using ES modules. For instance, the following code works correctly:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to integrate the x-sort plugin into my application, but I’ve encountered a few issues related to the loading order of Alpine.js.
When Alpine.js is loaded before the body is parsed, I receive a warning in the console suggesting that I should defer the loading of Alpine.js until after the body is fully parsed. However, according to the documentation for the x-sort plugin here, the plugin does not work unless it is loaded before the entire page is rendered. This indicates that deferring the script loading will not yield immediate results, whereas removing the defer keyword allows the sorting functionality to work as expected.
Additionally, I observed similar behavior when using ES modules. For instance, the following code works correctly:
However, if I change it to this:
The sorting functionality fails to work.
I am using following versions:
"@alpinejs/sort": "^3.14.1",
"alpinejs": "^3.14.1",
Could you please provide guidance on how to resolve these loading order issues with the x-sort plugin in Alpine.js? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions