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

Class components exported with vue-cli #275

Closed
mrodal opened this issue Oct 2, 2018 · 3 comments
Closed

Class components exported with vue-cli #275

mrodal opened this issue Oct 2, 2018 · 3 comments

Comments

@mrodal
Copy link

mrodal commented Oct 2, 2018

Hi everyone! Im building a library that is used by another project, and Im using vue-cli to generate the dist files:
vue-cli-service build --target lib --name libName entry.js

Everything is fine, except that when I try to use the library in the other project, I get
Super expression must either be null or a function

Debugging I found that the "missing super expression" is Vue from extends Vue, and I think it has something to do with what the documentation on build targets from vue-cli says:

Note on Vue Dependency

In lib mode, Vue is externalized. This means the bundle will not bundle Vue even if your code imports Vue

So I dont know how to handle this, how to make it use the Vue from my project and not the Vue from the library project...

If instead of using the class syntax I use the standard syntax, I dont get this error.

Has anyone seen this case? Looks like its not a weird case where we want to export components

@ktsn
Copy link
Member

ktsn commented Oct 9, 2018

Hello, please provide a reproduction when you report a bug. In your case you can create example GitHub repository as a reproduction. Thanks.

@ktsn ktsn added the need repro label Oct 9, 2018
@mrodal
Copy link
Author

mrodal commented Oct 9, 2018

Sorry for leaving this open. I kept looking into this and saw that it was more of a vue-cli issue and posted an issue there. Anyone getting this error might find it useful: vuejs/vue-cli#2675

@mrodal mrodal closed this as completed Oct 9, 2018
@ktsn
Copy link
Member

ktsn commented Oct 9, 2018

I see. Thank you for confirming!

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

No branches or pull requests

2 participants