Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yueyun opened this issue Aug 9, 2018 · 1 comment
Open

Comments

@Yueyun
Copy link

Yueyun commented Aug 9, 2018

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?

@luchg
Copy link

luchg commented Dec 21, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants