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

HTML class presets are broken in NuxtJS (+probably Vue) #156

Open
thely opened this issue Aug 20, 2021 · 3 comments
Open

HTML class presets are broken in NuxtJS (+probably Vue) #156

thely opened this issue Aug 20, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@thely
Copy link

thely commented Aug 20, 2021

In NuxtJS, using the HTML class presets turns up a window.lax is undefined error no matter how hard I try to make sure my plugin encapsulation of this library is actually client-side, which I definitely spent the better part of a day hitting my head against the wall over. But the lax.addElements() version of this library works fine in Nuxt so far. My guess is that the presets will probably break similarly in Vue, but I haven't tested that.

Here's my Codesandbox link. The index page uses lax.addElements() and works, the about page uses HTML classes and breaks.

@thely thely added the bug Something isn't working label Aug 20, 2021
@antiantivirus
Copy link

antiantivirus commented Oct 12, 2021

Also having this issue. Getting the same error as in the codesandbox above.

Cannot read property 'presets' of undefined

@antiantivirus
Copy link

Hack/fix available here #139

adding window.lax = { presets: this.$lax.presets } to mounted fixed the issue for me.

@derwaldgeist
Copy link

derwaldgeist commented May 19, 2022

I have the very same problem with React. It just throws:

Uncaught TypeError: Cannot read properties of undefined (reading 'presets')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants