Study notes - Vue project Failed to Compile compilation error

Inexplicable errors often occur during the compilation of the vue project.


1. Error example

Two, the reason 

1. The necessary files are missing in the project.

For example, the src/api/period/index.js file in the above example is missing, but this file is accessed elsewhere in the project.

Workaround: Add the missing file, or remove access to the file.

2. An error is reported when the project switches branches

This problem often occurs when using git to manage vue projects. Since the dependencies managed between branches may be different, some files may not be found after switching branches, resulting in compilation errors in the project.

Solution: After switching branches, re-download dependencies with yarn or npm.

Guess you like

Origin blog.csdn.net/qq_41339126/article/details/128952715