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
WOW not defined using npm package. #252
Comments
@jasonlam0619 run:
Then use: import WOW from 'wow.js'
const wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
live: true
}); |
Hi grain I used wow.js instead of wowjs, because it is not working with import ... from 'wowjs' and then tried the code you have provided. when I run in my html the output is it has no animate, see the screenshot: |
@graingert unfortunately, the code you mentioned does not work. Something changed? |
@graingert i have tried this code, but did not worked :/ |
any luck here? |
@JSantana90 i totally give up |
Same issue here... |
Same issue. Surely rather important as most developers are using NPM dependencies these days? |
same issue here, anyone found any solution? |
Not sure if this helps, but I got it to work using bootstrap.js
whatever.js
|
in your HTML file works instead of having to place it in your |
This didn't work either. I used |
@adammoisa Did you import WOW in anywhere of your scripts? |
I'm getting the same problem, it used to work fine with this line in the controller: new WOW().init(); and importing the script in the index.html, now I get the same error and it just won't work at all |
@Ruchern yes of course. As I said it adds the animated class to the HTML which I think implies the package is 'working' to some degree... |
@adammoisa I'm sorry. I did not mean that. Do you have Try either |
the module exports an object, the WOW constructor function is inside the returned object.
|
window.WOW = require('wowjs').WOW worked for me |
import { WOW } from 'wowjs'
window.WOW = WOW Perhaps this might work too. |
With require
|
To Leverage Undefined Values make sure that your DOMm is ready and likely when a dependent variable is not defined. When the page is loaded and ready, and likely when a dependent variable is already defined. |
This works like a charm |
Thanks bro this work for me |
Thanks bro this work for me |
|
React + Next js + typescript Works fine:
|
Hello,我是林昕,我已收到来信~
|
Try this, It works for me // import wowjs if window is not undefined
// then write this code in the function
I hope this is useful ; ) |
it works for me : )
npm i --save wow.js import { onMount } from 'svelte'
onMount(async () => {
import('wow.js').then((WOW) => {
new WOW.default().init()
})
}) or onMount(async () => {
const wow = await import('wow.js')
new wow.default().init()
}) |
#252 (comment) |
I found a better way to do it and it works. Currently I’m using
|
Hello,我是林昕,我已收到来信~
|
I did this:
npm install wowjs
and required it:
import WOW from 'wowjs
and tried to use it:
But I got
Uncaught ReferenceError: WOW is not defined
at console.The text was updated successfully, but these errors were encountered: