vue
vue copied to clipboard
Failed to compile, confused as a beginner
Bug report π
Version & Environment
- Windows 10 2004
- [email protected]
- [email protected]
- @geist-ui/[email protected]
Expection
A successful compilation.
Actual results (or Errors)
The error information displayed in the terminal is below:
gram Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run dev --scripts-prepend-node-path=auto
> [email protected] dev D:\Workspace\project-test
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
13% building modules 29/35 modules 6 active ...D:\Workspace\project-test\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
94% asset optimization
ERROR Failed to compile with 1 errors δΈε8:06:41
error in ./node_modules/_@[email protected]@@geist-ui/vue/dist/geist-ui.common.js
Module parse failed: Unexpected token (1851:25)
You may need an appropriate loader to handle this file type.
| const props = { size: [String, Number], color: String }
| const computed = {
| listeners() { return { ...this.$listeners } },
| styles() {
| const sizes = this.size ? { height: this.size, width: this.size } : {}
@ ./src/main.js 7:0-36
@ multi (webpack)-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js
It looks like the error came from the webpack configuration, but I'm not sure.
Can you provide the simplest online project as an example to reproduce this error so that I can track down the cause of the error?
I have created a repository named "project-test", which may be what you required. Hoping that you can help me solve the problem, thanks!
You can focus on the following points:
- Compiling
object-rest-spreadsyntax withbabel. (this is theobject-rest-spreadstatement of@geist-ui/vuethat was not compiled) babeldoes not compile the contents ofnode_modulesby default. You can upgradebabelto version 7 and then use configuration filebabel.config.jsto compile the module from filenode_modules. references: You want to compile node_modules?