'Library constructor is not a function
I'm using Aurelia V2 for javascript UI HTML app, i'm trying to add new library using yarn (the project is configured to use yarn instead of npm), so i did two projects:
first project uses aurelia v2 and is running on my laptop, after that i have executed yarn add interactjs to add this library (interactjs), after run the project uwing npm start o yarn start i can see the web page and a div element can be resized using the mouse pointer, everything goes works well !.
second project is a big project from one of my clients, is using almost the same configuration (aurelia v2 and yarn), so i have added interactjs library with yarn add command and everything goes fine... but when i try to vizualize the web page this error appears in chrome console:
Code
import * as interact from 'interactjs';
const resizeable = interact('.resizable'); // target elements with the "resizable" CSS class
Error
Uncaught (in promise) TypeError: (0 , _interactjs.interact) is not a function
And the code is the same in both, i have copied library imports from my laptop app to the other app.
My laptop app is running locally, the other app with this issue is running with azure cloud and other security measures like Content Delivery Network (CDN), etc.
I've tried to change the const line to call this as a constructor but after that is showing another error: interact is not a constructor, could be EC6 EC5 compatibility since i can not to see some properties due strict mode in the second app ???
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
