>PROBLEM
Mysterious compilation errors suddenly appeared after restarting app.
It may happen with any framework/language.
Context:
Everything was done right and the modifications implemented were compiled successfully. Suddenly, after restarting the app, many error messages come from nowhere and they seem not compatible with the code written.
>SOLUTION
When the compilation goes mad, indicates that something outside the project, pertaining to the O.S. system has come to the scene.
Most common causes that occurred to me:
- HD issue
- Corrupted files.
- Non-visible chars (the worst scenario) resulting in unexpected combinations..
The first two causes may be easier to find out.
The third may turn your search into hell.
Through the editor used during the project implementation may not help, because the issue in this cases usually comes transparent to it. For instance, if you are using VS Code (excellent), it will be necessary to use another one to identify the issue, for instance the Notepad++, SciTE, or another one.
In the image below, check the red arrow.
The strange char comes out.
It doesn't help correcting in the editor. The issue may persist because it may have not visible chars during the fix, and they will be still there and may cause more issues.
The best thing to do is to create a new file and retype the code.
You may risk doing just this with just the defective line.
Better if you replace all the code from another source or manually.
This kind of issue happened to me three times and the first one drove me crazy.
>VERSIONING CONTROL SIDE EFFECTS (Git, etc.)
Non-visible chars produce issues to the compiler and also to any other software working with the files, and that is the case of the versioning control, spoiling the merges.
>ENV
Windows
Node.js
Angular 12 and higher.
No comments:
Post a Comment