Vue-class-component: error of default is not a function with systemjs-importmap

Created on 21 Aug 2019  路  4Comments  路  Source: vuejs/vue-class-component

systemjs-importmap.json:

{
    "imports": {
        "vue": "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js",
        "vue-class-component": "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-class-component.min.js"
    }
} 

Adding vue-class-component decorator to my Vue repo caused an error
TypeError: vue_class_component_1.default is not a function

Way to reproduce:
1) npm run deploy
2) npm run www
3) browser loading http://localhost:3000/

Most helpful comment

/cc @kaorun343

All 4 comments

This is because the way UMD build exposes the decorator is different with ESModule. Using ESM build should fix the problem.

@ktsn Thank you for new vue-class-component version! Waiting for vue-property-decorator version update (with esm support).

/cc @kaorun343

Was this page helpful?
0 / 5 - 0 ratings