Closed amanopia closed 1 year ago
Hmm, yeah I think the target type detection is confused by the environment. Would you mind sharing the code somewhere so I can have a better look? Thanks
Here is the link to the code: https://github.com/amanopia/dribbble-pages/tree/main/NodeApplication Thanks!
Can you try console.log(document.querySelectorAll('.toggle-dot'));
in home.js
and tell me what it returns?
I am still getting the 500 internal server error (a.hasOwnProperty is not a function), with the same call stack being displayed along with it. The script isn't even loading. I tried using an alert message, but nothing came on the screen
Sorry, by removing the anime
call to prevent the error, so you can read the console.log(document.querySelectorAll('.toggle-dot'));
Still, even after removing the anime
call, I am getting the same thing
I did try removing the app.use()
call for the anime library in the server file, and adding a script tag to the index.hbs
file along with putting back the anime call, but now it says that `anime is not defined...
It's really hard for me to see why this error occurs even if you don't call anime.js?. Might also be related to https://github.com/juliangarnier/anime/issues/345 V4 might fix that
I found a work-around. Went to
anime.js
alongside home.js, and put the un-minified code therescript
tags like so:
Is it a good practice and is it unethical if I do it this way while pushing the software in production? Not that I am pushing it in production or anything, it's just a UI project for my portfolio, and I just wanted to use the library because it seemed great. Is it okay if I go with this, and are there any cons associated with doing it this way? Thanks!
Well now I'm even more confused...
is it a good practice and is it unethical if I do it this way while pushing the software in production?
It should be fine!
I am sorry for causing any confusion 😅. Here is the link to the repo, in case you want to have a look https://github.com/amanopia/dribbble-pages/tree/main/NodeApplication/public/js And checked out a glimpse of v4 on your Twitter handle, looks great! Gonna wait for that! Thank you so much for the help!
I'm glad it's working!
a.hasOwnProperty is not a function after importing animejs js into my node environment using
import anime from 'animejs'
and registering it as a middleware with express usingapp.use(anime)
as soon as I start the server, I am getting the following errorTo Reproduce Steps to reproduce the behavior:
npm install animejs --save
const port = 3000; app.listen(port, () => { console.log("server started on port 3000"); })
const filename = fileURLToPath(import.meta.url); const dirname = path.dirname(__filename);
// registering middleware to render static assets app.use(express.static(path.join(__dirname, "../public")))
Expected behavior The element should be animated. The reason might be
a
being expected to be an object which might be actually not. And callinghasOwnProperty
on a non-object might be causing the issue. I tried debugging the codebase but this is only what I could understandScreenshots
Desktop (please complete the following information):