custombox
custombox copied to clipboard
Can't import it as a module
It seems to be missing module definition in compiled and minified version.
Therefore I can't import it using import Custombox from 'custombox'
.
Requiring custombox.ts with ts-loader brought a lot of other issues.
Surprisingly, version 3.0.2 had the module definitions.
Hi @scarfacedeb, What do you want do exactly?
Reagards.
In console:
npm install custombox --save
In code:
import Custombox from 'custombox';
new Custombox.modal({
content: {
effect: 'fadein',
target: '#popup'
}
}).open();
And then finally in browser:
Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_1_custombox___default.a.modal is not a constructor
@zeleniy the same to you,Have you solved this problem?Please help me..Thanks
@hqa11 no, i used https://github.com/frontend-collective/react-image-lightbox instead of that tool
If someone has this issue with webpack. Use "yarn add https://github.com/HeshamMeneisi/custombox" until someone accepts the pull request.
Any update here?
Any update here?
@gp0 this is what I had to do:
require('./assets/vendor/custombox/dist/custombox.legacy.min.js');
PS commander keen is boss