larsgw / citation.js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
https://citation.js.org/
MIT License
219 stars 30 forks source link

Vue + citation-js error ReferenceError: regeneratorRuntime is not defined #185

Closed Rytiggy closed 5 years ago

Rytiggy commented 5 years ago

I am running a Quasar app (framework built on top of Vue).

this is my function im calling to generate a citation but I get the above error whenever I declare new Cite

 generateCitation() {
      const example = new Cite('Q21972834');

      const output = example.format('bibliography', {
        format: 'html',
        template: 'apa',
        lang: 'en-US',
      });

      console.log(output);
    },

As a note my require statement is at the top of the script.

Here is the actual error message: Screen Shot 2019-06-21 at 3 05 40 PM

Any ideas what could be going on?

larsgw commented 5 years ago

Sorry for the slow response, this seems to have slipped through the cracks. It looks like the new mjs build (which gets used by Webpack) is expecting @babel/polyfill, which isn't there. The next release (v0.4.8) will have a patch in the build process which fixes the error when I try it.