babel-plugin-component icon indicating copy to clipboard operation
babel-plugin-component copied to clipboard

import 'class' constructor, console ok, but new class is not defined

Open Yueyun opened this issue 5 years ago • 1 comments

I'm using babel-plugin-component here's my import import {CanvasPoster} from 'ui-lib' but when I using this: new CanvasPoster() it says

myPoster.vue?7d2b:33 Uncaught (in promise) ReferenceError: CanvasPoster is not defined

but i can console.log(CanvasPoster)

function CanvasPoster() { __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, CanvasPoster);

i can fix this problem to change

import CanvasPoster from 'ui-lib/lib/CanvasPoster',

does anyone know why this happen?

Yueyun avatar Aug 09 '18 07:08 Yueyun

我也遇到了一模一样的问题!

luchg avatar Dec 21 '18 16:12 luchg