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

Can't use template in single file component #5880

Closed
wansj opened this issue Jun 14, 2017 · 3 comments
Closed

Can't use template in single file component #5880

wansj opened this issue Jun 14, 2017 · 3 comments

Comments

@wansj
Copy link

wansj commented Jun 14, 2017

Version

2.3.4

Reproduction link

https://github.com/wansj/shift

Steps to reproduce

1.meteor create project-name --full
2.meteor remove blaze-template reactive-var standard-minifier-css
3.meteor add akryum:vue-component static-html juliancwirko:postcss
4.create App.vue and NotFound.vue in the imports/ui/pages directory, The content can be found https://github.com/wansj/shift/blob/master/imports/ui/pages/App.vue and https://github.com/wansj/shift/blob/master/imports/ui/pages/NotFound.vue
5.Replace the imports/startup/client/routes.js with https://github.com/wansj/shift/blob/master/imports/startup/client/routes.js
6.Replace the imports/startup/client/index.js with https://github.com/wansj/shift/blob/master/imports/startup/client/index.js
7.meteor run

What is expected?

Help!

What is actually happening?

I got:
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.


I'm writing a vue meteor app, and I used the akryum:vue-component@0.9.2 package.My vue version is 2.3.4, meteor version is 1.5.

@nickmessing
Copy link
Member

Vue ships in 2 variants, runtime-only has no template-compiler in runtime, to use standalone build you can use import Vue from 'vue/dist/vue.esm.js' instead of import Vue from 'vue'.

P.S. please to ask questions use forum or gitter instead of opening issues on github.

@wansj
Copy link
Author

wansj commented Jun 14, 2017

@nickmessing Thank you, I will have a try.

@wansj
Copy link
Author

wansj commented Jun 14, 2017

import Vue from 'vue/dist/vue.esm.js' caused Uncaught SyntaxError: Unexpected token export. Because vue.esm.js uses es6 module export, which can't be recoginized by meteor even if I add the poorvavyas:es6-shim package. But import Vue from 'vue/dist/vue.js' works for me.

@wansj wansj closed this as completed Jun 14, 2017
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