gajus / swing

A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder.
Other
2.63k stars 247 forks source link

Swing won't run on my webpack #127

Closed easalazarmiran closed 6 years ago

easalazarmiran commented 6 years ago

Hi! How are you? I'm very new to using webpack and I think I am making a mistake when importing the package to the application.js file. Even though it is compiling successfully with the new library, I'm getting an error on the console and can't seem to be able to use the functions of the library on my .js files.

import Swing from "swing"; const swipes = document.querySelectorAll(".button-swipes") const card = document.querySelector(".card") //swipe using swing: //Initialize an instance of Stack const stack = Swing.Stack();

And the error i'm getting in the console says:

deck.js:9 Uncaught TypeError: Cannot read property 'Stack' of undefined at Object.<anonymous> (deck.js:9) at Object.defineProperty.value (deck.js:51) at __webpack_require__ (bootstrap d955d73d3325972391a3:19) at Object.<anonymous> (application.js:1) at __webpack_require__ (bootstrap d955d73d3325972391a3:19) at bootstrap d955d73d3325972391a3:62 at bootstrap d955d73d3325972391a3:62

Thank you so much, i am very looking forward to using Swing!!!

yannklein commented 2 years ago

Hey @easalazarmiran Very late reply but, for future ref, try this way to import:

import * as Swing from 'swing'