We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here is what I did
import { Tween } from "gsap/gsap-core"; import momentum from "momentum.js/dist/momentum.min.js"; const animateHeroImages = () => { // Some random function }; const draggable = () => { const cloud = document.querySelector(".cloud"); const container = document.querySelector(".hero-container"); console.log(cloud, container); let drag = new momentum.Draggable(cloud, { container: container, friction: 0.055, containerBounds: true, resizeUpdate: true, autoAnchor: true, }); console.log(momentum); }; export { animateHeroImages, draggable };
This gives me console error -
indexScripts.js:42 Uncaught (in promise) TypeError: _momentumMin.default.Draggable is not a constructor.
Also when I console log the imported momentum from the dist folder, it returns an empty object.
I am using -
The text was updated successfully, but these errors were encountered:
Hi @nileshinkane
Try updating to version 1.2.2. With that version you are able to use normal imports:
1.2.2
import { Draggable } from "momentum.js";
Parcel should handle the rest :)
Sorry, something went wrong.
No branches or pull requests
Here is what I did
This gives me console error -
indexScripts.js:42 Uncaught (in promise) TypeError: _momentumMin.default.Draggable is not a constructor.
Also when I console log the imported momentum from the dist folder, it returns an empty object.
I am using -
The text was updated successfully, but these errors were encountered: