1. Cause
A new configuration file of vetur.config.js is added in vetur 0.31.0.
after this version, priority will be given to finding whether the project is equipped with tsconfig.json (TS project) or jsconfig.json (JS project).
if these two files are not found, go to vetur.config.js. If they are not found, this prompt will be thrown.
2. Explain
The JavaScript support of vscode can run in two different modes:
file range (without jsconfig.JSON)
in this mode, JavaScript files opened in vscode are regarded as independent units
as long as the file A.js does not explicitly reference the file b.ts (using// reference instructions or commonjs modules), there is no common project context between the two files.
3. Explicit project
(use jsconfig.JSON)
The JavaScript project is defined through the jsconfig.JSON file. The existence of such a file in the directory indicates that the directory is the root directory of the JavaScript project
the file itself can optionally list files belonging to the project, files to be excluded from the project, and compiler options (see below)
the JavaScript experience improves when you have a jsconfig.json file in your workspace that defines the project context
therefore, when you open a JavaScript file in a new workspace, we provide a prompt to create a jsconfig.json file.
4. Solution (1 out of 3)
4.1. Configure the vehicle plug-in and ignore the prompt </ H6>
"vetur.ignoreProjectWarning": true,
4.2. Create jsconfig.json file in the project root directory </ H6>
Add code:
{
"include": [
"./src/*"
]
}
4.3. Create the vetur.config.js file in the project root directory </ H6>
Add code:
module.exports = {
// vetur configuration, which will override the settings in vscode. default: `{}`
settings: {
"vetur.useWorkspaceDependencies": true,
"vetur.experimental.templateInterpolationService": true
},
// Normal projects use the default configuration default: `[{ root: './' }]`
}
Read More:
- [Solved] TypeError: Converting circular structure to JSON – JSON.stringify
- [Solved] JSON.parse() Error: Unexpected end of JSON input
- How to Solve JS error: Unexpected end of JSON input,Unexpected token u in JSON at position 0
- The vue3 project Error: Cannot find module’vue-loader-v16/package.json’
- [Solved] Prittier format code error: JSON Error in…
- [Solved] Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
- [Solved] Error: Cannot find module ‘vue-template-compiler/package.json‘ Require stack:
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- [Solved] Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension
- VScode vue3 Project vetur Error [How to Solve]
- [Solved] electron Package and Startup Error: Error: ENOENT: no such file or directory, open ‘xxx/manifest.json‘‘
- Json.parse: All Error & How to Solve Them
- [Solved] ajax Error: Uncaught SyntaxError: Unexpected end of JSON input
- [Solved] Error in created hook: “SyntaxError: Unexpected token o in JSON at position 1“
- Module not found: Error: Can‘t resolve ‘core-js/modules/es.promise.js‘ in
- How to Solve Converting circular structure to JSON‘ Error
- Such a simple serialization system.text.json.serialization also reports an error?
- Error in created hook: “SyntaxError: Unexpected token u in JSON at position 0
- [Solved] Vue-cli Error: Module not found: Error: Can‘t resolve ‘vue-router ‘
- [Solved] VS Code Debug JavaScript Error: “crbug/1173575, non-JS module files deprecated”