htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.9k stars 309 forks source link

Vue: autoInit fires error upon App mount #491

Open RSchmitzHH opened 3 weeks ago

RSchmitzHH commented 3 weeks ago

Summary

The Vue installation guide advises to add a window.HSStaticMethods.autoInit(); to the onMounted() of the basic App.vue. However, this fires an error at l. 152

Steps to Reproduce

Following the preline Vue installation notes at [https://preline.co/docs/frameworks-vuejs.html](), I added

  setTimeout(() => {
    window.HSStaticMethods.autoInit();
  }, 100)
});

to App.vue.

However, directly at startup, this fires the following error from preline.js, l. 152:

Uncaught TypeError: Cannot read properties of undefined (reading 'getAttribute')
    at new e (preline.js:152:992)
    at preline.js:152:2902
    at NodeList.forEach (<anonymous>)
    at e.autoInit (preline.js:152:2756)
    at preline.js:207:255
    at Array.forEach (<anonymous>)
    at Object.autoInit (preline.js:207:212)
    at App.vue:28:28

(cf. screenshot below)

autoInit error

I should be at the newest version

   "@preline/accordion": "^2.5.0",
    "@preline/collapse": "^2.5.0",
    "@preline/copy-markup": "^2.5.0",
    "@preline/dropdown": "^2.5.0",
    "@preline/overlay": "^2.5.0",
    "@preline/select": "^2.5.1",
    "@preline/stepper": "^2.5.1",
    "@preline/tabs": "^2.5.0",
...
    "preline": "^2.5.1",

Demo Link

N/A

Expected Behavior

Should not fire an error

Actual Behavior

Does fire an error

Screenshots

autoInit error
arthures11 commented 1 week ago

i have the same issue, angular image