Alpine processes DOM top-to-bottom. x-data='wsInit()' was evaluated before the script defining wsInit() was parsed. Moved Alpine.data registration to a script tag BEFORE the x-data div. Also removed duplicate script block at the bottom.
Alpine processes DOM top-to-bottom. x-data='wsInit()' was evaluated before the script defining wsInit() was parsed. Moved Alpine.data registration to a script tag BEFORE the x-data div. Also removed duplicate script block at the bottom.