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

Vue: autoInit fires error upon App mount #491

Open
RSchmitzHH opened this issue Oct 31, 2024 · 3 comments
Open

Vue: autoInit fires error upon App mount #491

RSchmitzHH opened this issue Oct 31, 2024 · 3 comments

Comments

@RSchmitzHH
Copy link

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
Copy link

i have the same issue, angular
image

@RSchmitzHH
Copy link
Author

Any comment by the authors? Getting all these errors right on startup is quite unsatisfactory, I must say...

@olegpix
Copy link
Collaborator

olegpix commented Nov 27, 2024

@RSchmitzHH
Could you please share a link to your code? It seems like the required markup might be missing, as the error suggesting that the function can't find the needed attribute typically points to this issue.

In the meantime, you can refer to the basic demo for Vue, which was created to illustrate the correct project setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants