I have an Angular app which runs perfectly in my local and production environment.. After a tiny change I made, I ran the app locally and it works fine.. Then I built the pr
I had the same issue:
1) I ran the command
ng build --aot --prod
2) Everything compiled without an error
3) I deleted all the files on the server and copied it all across via FTP(FileZilla) to a windows Azure server
4) Sometimes I get the error
Unexpected token <
and other-times not
Yesterday I noticed that the main[hash].js was missing on the server and that Filezilla did not give me an error copying it.
I then tried copying only that file.It did not work. When I removed the hash part from the filename it copies without a problem.
Work-a-round
Run:
ng build --aot --prod --output-hashing none
Which works every-time.
So either Filezilla or Windows Server does not allow filenames with a specific length or it does not like certain hashes.