Tag Archives: Front end frame

[Solved] 1:1 error Component name “Header“ should always be multi-word vue/multi-word

An error occurred while starting the vue project:

1:1 error Component name “Header” should always be multi-word vue/multi-word

The reason is that the nonstandard code (that is, nonstandard naming) is regarded as an error during the syntax check

Solution:

Add the configuration: lintOnSave: false in the vue.config.js file, as follows:

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false
})

[Solved] ESlint Create New File Error: Component name “Home” should always be multi-word.

Find the rules in the configuration of your ESlint and add such a configuration, set the value off, and you will not get the error message.

"vue/multi-word-component-names":0

Find the vue.config.js file in your project, add the following codes:

lintOnSave: false

After saving and recompiling, the problem is solved

[Solved] ant design pro vue Startup Error: ERROR Failed to compile with 1 error 20:34:09 error in ./src/components/Num

Error reporting information

ERROR Failed to compile with 1 error 20:34:09

error in ./src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true&

Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent’)

Delete the NumberInfo folder under the components folder, start the project again, and after starting, Ctrl + z to withdraw the deleted NumberInfo component folder, after which the project will start normally

Solution:

1. Delete, yarn run serve to start project

2. Withdrawal

3. Project started successfully

core-js/modules/es.error.cause.js [How to Solve]

Reason: the installed version of core-js is too old and needs to be replaced with a newer version.

Solution:
1 Delete original version

 npm rm -rf node_modules  

2. install the latest version

npm install core-js@latest

Note:
you cannot directly install a new version. You must first delete the original version dependency, and then install a new version to avoid errors!

[Solved] error Component name “xxx“ should always be multi-word vue/multi-word-comp

Project issues

An error was encountered in the Vue project today. The console reported error Component name “xxx“ should always be multi-word vue/multi-word-comp, which is mainly the error reported by eslint standardization

 

Solution:

Turn off naming rule verification
find it in the root directory eslintrc.js file, add the following code:

   "vue/multi-word-component-names":"off",

.eslintrc.js file content: