custombox icon indicating copy to clipboard operation
custombox copied to clipboard

Can't import it as a module

Open scarfacedeb opened this issue 7 years ago • 9 comments

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.

scarfacedeb avatar Jun 21 '17 01:06 scarfacedeb

Surprisingly, version 3.0.2 had the module definitions.

scarfacedeb avatar Jun 21 '17 01:06 scarfacedeb

Hi @scarfacedeb, What do you want do exactly?

Reagards.

dixso avatar Jun 22 '17 05:06 dixso

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 avatar Sep 27 '17 11:09 zeleniy

@zeleniy the same to you,Have you solved this problem?Please help me..Thanks

hqa11 avatar Sep 08 '18 11:09 hqa11

@hqa11 no, i used https://github.com/frontend-collective/react-image-lightbox instead of that tool

zeleniy avatar Sep 08 '18 20:09 zeleniy

If someone has this issue with webpack. Use "yarn add https://github.com/HeshamMeneisi/custombox" until someone accepts the pull request.

HeshamMeneisi avatar Mar 11 '19 01:03 HeshamMeneisi

Any update here?

hunterInt avatar Oct 31 '20 02:10 hunterInt

Any update here?

gp0 avatar Feb 19 '21 17:02 gp0

@gp0 this is what I had to do:

require('./assets/vendor/custombox/dist/custombox.legacy.min.js');

PS commander keen is boss

hunterInt avatar Feb 20 '21 06:02 hunterInt