plantain-00 / schema-based-json-editor

A reactjs and vuejs component of schema based json editor.
MIT License
168 stars 38 forks source link

Module not found: Error: Can't resolve 'vue-class-component' #1

Open Senci opened 7 years ago

Senci commented 7 years ago

When trying to use the Vue-component i get the following error:

ERROR in ./~/schema-based-json-editor/dist/vue.js
Module not found: Error: Can't resolve 'vue-class-component' in '/Users/sli/Documents/shub/connectors/hbci_parser_api/src/web-frontend/node_modules/schema-based-json-editor/dist'
 @ ./~/schema-based-json-editor/dist/vue.js 3:28-58

As vue-class-component is imported/required in the compiled component, this module probable needs to be listed as npm dependency. In contrast to being a dev-dependency.

Unfortunately after installing it and being able to compile, the component causes an error (Uncaught ReferenceError: __extends is not defined) during runtime. I'll take a deeper look into it and keep you updated.

plantain-00 commented 7 years ago

This library should also works with angular and react, when they don’t rely on vue-class-component, so I cannot add vue-class-component in the dependencies.

I just added it in the document.

(__extends is not defined) problem can be solved by updating to the latest version(3.7.2) or add code like:

import { __extends, __decorate, __assign } from "tslib";
window.__extends = __extends;
window.__decorate = __decorate;
window.__assign = __assign;

I just moved them into the library, so you don’t have to write it in your code.