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 Stackconst stack = Swing.Stack();
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!!!