jedfoster/Readmore.js

ReferenceError: Readmore is not defined

hector-sanchez opened this issue · 3 comments

Hey. I am having issue getting v 3.0 to work. I followed the steps in the installation but I am getting a ReferenceError: Readmore is not defined error. This is my code:

import Readmore from 'readmore-js'

 new Readmore('[data-fe=faq-answer]', {
      speed: 75,
      moreLink: '<a href="#">Read more</a>',
      lessLink: '<a href="#">Read less</a>'
    });

And yes, I installed the package as evidenced by the following line in my package.json:
"readmore-js": "^3.0.0-beta-1",

See any issues with my approach?

@hector-sanchez Did you find the solution to this issue? If so, what was it?

I'm having the same issue? Any fix?

Try importing the ES6 module directly

import Readmore from 'readmore-js/dist/readmore.es6.js';