Update
It turns out the issue is related to the used boilerplate. A workaround is to not extract the TypeScript file, but instead keep it in the .vue file for now.
I'm getting this error in a simple Vue test project:
ERROR Failed to compile with 1 errors
error in ./src/App.ts
Syntax Error: Unexpected token (11:7)
It is basically the default project you get when running:
vue init Toilal/vue-webpack-template my-project
The specific code that fails:
@Component
export default class HelloWorld extends Vue {
@Prop({ default: 'default ToDo' })
todo: string; // unexpected token
name = "test9"; // fine
}
Everything else seems to be working fine and I did not see anyone complain about ':' being an unexpected token on my search for answers. One guy had that issue about 2 years ago and fixed it by using a new npm version, but I am obviously on a much never version anyways.
These are the dependency sections from my package.json as I guess my issue is with some odd library combination?
"dependencies": {
"vue": "^2.5.2",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^6.0.0"
},
"devDependencies": {
"@types/node": "^6.0.10",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eventsource-polyfill": "^0.9.6",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"fork-ts-checker-webpack-plugin": "^0.3.0",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"raw-loader": "^0.5.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"ts-loader": "^2.0.3",
"typescript": "^2.6.2",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
}