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

Remove dependency on vue-template-compiler #250

Closed
ThinkRealize opened this issue Jun 22, 2017 · 7 comments
Closed

Remove dependency on vue-template-compiler #250

ThinkRealize opened this issue Jun 22, 2017 · 7 comments

Comments

@ThinkRealize
Copy link

  • Platform: macOS
  • Vetur version: 0.8.1
  • VSCode version: 1.13.1

/Users/a56832357/.vscode/extensions/octref.vetur-0.8.1/client/node_modules/vue-template-compiler/index.js:8
throw new Error(
^

Error:

Vue packages version mismatch:

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

at Object.<anonymous> (/Users/a56832357/.vscode/extensions/octref.vetur-0.8.1/client/node_modules/vue-template-compiler/index.js:8:9)
at Object.<anonymous> (/Users/a56832357/.vscode/extensions/octref.vetur-0.8.1/client/node_modules/vue-template-compiler/index.js:20:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/a56832357/.vscode/extensions/octref.vetur-0.8.1/client/node_modules/vue-language-server/dist/modes/script/typescript.js:5:31)
@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented Jun 22, 2017

I cannot reproduce it. Note vetur is for Vue2.

Would you please add more information about your setup? Also, inspecting ~/.vscode/extensions/octref.vetur to see if vue is in node_modules is helpful.

@ThinkRealize
Copy link
Author

Still the same mistake in vetur, my project vue version is 2.3.0. ~/.vscode/extensions/octref.vetur no have vue in node_modules.This is setup
// 将设置放入此文件中以覆盖默认设置
{
"workbench.iconTheme": "material-icon-theme",
"editor.fontSize": 12,
"editor.tabSize": 2,
"files.autoSave": "onFocusChange",
"extensions.autoUpdate": true,
"window.zoomLevel": 1.2,
"auto-rename-tag.activationOnLanguage": [
"html",
"xml",
"php",
"javascript",
"vue"
],
"workbench.colorTheme": "Material Night",
"javascript.validate.enable": false,
"standard.enable": false,
"standard.autoFixOnSave": true,
"standard.validate": [
"javascript",
"javascriptreact",
{ "language": "html", "autoFix": true },
{ "language": "vue", "autoFix": true }
],
"standard.options": {
"plugins": ["html"],
"parser": "babel-eslint",
"ignore": [
"node_modules/"
]
},
"editor.snippetSuggestions": "top",
"eslint.validate": [
"javascript",
"javascriptreact",
"vue"
],
"editor.wordWrap": "wordWrapColumn",
"workbench.welcome.enabled": true,
"search.useIgnoreFilesByDefault": true,
"files.exclude": {
"
/.git": true,
"/.svn": true,
"
/.hg": true,
"/CVS": true,
"
/.DS_Store": true,
".class": true,
"
.jar": true,
"/node_modules": true
},
"colorize.languages": [
"javascript",
"css",
"sass",
"scss",
"less",
"pcss",
"sss",
"stylus",
"xml",
"svg",
"vue",
"json"
],
"colorize.files_extensions": [
".diff"
],
"css.colorDecorators.enable": false,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
},
"editor.minimap.enabled": true,
"search.exclude": {
"
/node_modules": true,
"/bower_components": true,
"
/.class": true,
"**/
.java": true
},
"terminal.integrated.shell.osx": "/usr/local/bin/fish",
"editor.multiCursorModifier": "ctrlCmd",
"material-icon-theme.folders.icons": "blue",
"editor.renderIndentGuides": false,
"sync.gist": "33fcc16d5a905a1924c76037d25334ac",
"sync.lastUpload": "2017-06-22T10:34:47.781Z",
"sync.autoDownload": false,
"sync.autoUpload": false,
"sync.lastDownload": "2017-06-11T14:52:46.930Z",
"sync.forceDownload": false,
"sync.anonymousGist": false,
"sync.host": "",
"sync.pathPrefix": "",
"sync.quietSync": false,
"annotator.annotationCommitColorRange": [
"#f68018",
"#fdd674"
],
"projectManager.git.baseFolders": [
"/Users/a56832357/work/git"
],
"projectManager.openInNewWindowWhenClickingInStatusBar": true,
"editor.wordWrapColumn": 100,
"workbench.editor.enablePreview": false,
"translation.targetLanguage": "zh",
"translation.fromLanguage": "en",
"scss.colorDecorators.enable": false,
"scss.showErrors": true,
"scss.scanImportedFilesDepth": 3,
"css.validate": false
}

@ThinkRealize ThinkRealize reopened this Jun 23, 2017
@ThinkRealize ThinkRealize changed the title update vetur 0.8.1, vue packages version mismatch error update vetur 0.8.3, vue packages version mismatch error Jun 23, 2017
@tangdw
Copy link

tangdw commented Jun 23, 2017

F1 -> setting ->
"vetur.validation.script": false,
"vetur.validation.style": false,
"vetur.validation.template": false,

@ThinkRealize
Copy link
Author

@tangdw Thanks, but is invalid for me.

@octref
Copy link
Member

octref commented Jun 23, 2017

@HerringtonDarkholme

See #135 (comment)
Previously I modified vue-template-compiler source code to remove the version check here: https://github.com/vuejs/vue/blob/dev/packages/vue-template-compiler/index.js
vue-template-compiler code doesn't look like it's feasible to add an option to disable the check. What do you think is a good approach?

@HerringtonDarkholme
Copy link
Member

@octref I just checked related code. I think the best way is to totally remove vue-template-compiler. Since we have already done region parsing ourselves there seems little value to depend on external. Also #263 is related. The wrong line error is caused by wrong padding and wrong substitution.

@octref
Copy link
Member

octref commented Jun 23, 2017

Sounds good. And think maybe we can instead of doing padding, only send the script region and keep track of the offset, and in each language feature add back that offset.

@HerringtonDarkholme HerringtonDarkholme changed the title update vetur 0.8.3, vue packages version mismatch error Remove dependency on vue-template-compiler Jun 23, 2017
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

4 participants