jedfoster/Readmore.js

Can't use 3.0.0-beta-1 with Parcel

Closed this issue · 1 comments

If in index.js I write

require('readmore-js');
new Readmore('.event-description');

I get Uncaught ReferenceError: Readmore is not defined.


If I try

const Readmore = require('readmore-js');
global.Readmore = Readmore;

new Readmore.default('.event-description');

I get Uncaught TypeError: Cannot read property 'default' of undefined.


And if I go

const Readmore = require('readmore-js');
new Readmore('.event-description');

I get Uncaught TypeError: Readmore is not a constructor.

It was my fault, I installed version 2.0.0… By the way this one is the one that works:

const Readmore = require('readmore-js');
global.Readmore = Readmore;

new Readmore.default('.event-description');