SparkPost / heml

HEML is an open source markup language for building responsive email.
https://heml.io
MIT License
4.33k stars 157 forks source link

Trying to use Heml as NPM module #80

Closed marcelo2605 closed 6 years ago

marcelo2605 commented 6 years ago

This is my first attempt to use Heml as a NPM module to run with Vue.js. My plan is build a visual interface to create emails and output HTML+CSS using Heml. But I'm stuck in an error after import the lib and initialize it.

import Vue from 'vue'
import App from './App.vue'
import Heml from 'heml'

Vue.config.productionTip = false

new Vue({
  render: h => h(App)
}).$mount('#app')

const heml = new Heml;

const options = {
  validate: 'soft', // validation levels - 'strict'|'soft'|'none'
  cheerio: {}, // config passed to cheerio parser
  juice: {},
  beautify: {}, // config passed to js-beautify html method
  elements: [
    // any custom elements you want to use
  ]
};

heml('<heml> <head> <subject>My Email</subject> </head> <body> <container> <row> <column><p>hi there!</p></column> </row> </container> </body> </heml>', options).then(({ html, metadata, errors }) => { console.log(html)})

This code return an error related to pollyfill.js

Uncaught TypeError: Cannot read property 'match' of undefined