1

We have deployed an angular SSR application using universal/express-engine in IIS in a sub domain. When we try to access the application, we have an intermittent issue. The files are loaded only partially and it is throwing the below error.

In Chrome :

Uncaught SyntaxError: Invalid or unexpected token

In FireFox :

Uncaught SyntaxError: "" literal not terminated before end of script

enter image description here

When I check the main.js file, the HTTP call is a success but I can see only ~63kb out of the 300kb file is loaded. Not sure why this is happening.

We have tried removing the IIS compression altogether, that does not seem to be the issue. We can see that the SSR loads the application like supposed but when the CSR loads we are facing this issue intermittently. When we redeploy, it works for the initial five-six times and then starts throwing the error.

We did not find any errors in the log, only a DeprecationWarning: Buffer() is deprecated due to security and usability issues. Could that be causing the issue? We are not using it in our application it is used only in the external libraries.

Has anyone faced a similar issue before? Any help is appreciated

Thanks in advance :)

Ragul Parani
  • 621
  • 7
  • 22
  • Will there be this error when running this application locally? and now that you have got DeprecationWarning, you can try to use the new Buffer method, and then see if this error still occurs. about how to use new Buffer method you can refer to this link: [https://stackoverflow.com/a/52257416/13336642](https://stackoverflow.com/a/52257416/13336642). – samwu Jul 12 '21 at 02:43
  • @samwu We are not facing this error when I am running this locally. And we are not using Buffer inside our application. It is used as a dependency by Webpack i guess – Ragul Parani Jul 12 '21 at 04:35
  • Are there any error messages in the log file? there is also Event Viewer. Does the file that cannot be loaded in the console have a status code? – samwu Jul 13 '21 at 06:30
  • The status code is 200. And there is only the warning that i have mentioned – Ragul Parani Jul 14 '21 at 21:50
  • It is difficult to know your problem based on these warning, you can try to use failed request tracking to view detailed error information. – samwu Jul 16 '21 at 07:32
  • If you look at the preview tab for that file, can you see if the file is complete? And is 300 kB the compress or uncompressed expected size? – David Jul 16 '21 at 08:03
  • Size is the combined size of the response headers (usually a few hundred bytes) plus the response body, as delivered by the server. Content is the size of the resource's decoded content. If the resource was loaded from the browser's cache rather than over the network, this field will contain the text (from cache). – samwu Jul 16 '21 at 08:54
  • @David 300kb is the expected uncompressed file size. – Ragul Parani Jul 16 '21 at 09:57
  • @samwu We've been trying to figure this out till now. If we get the issue, I'll add it in the answer. Not getting much help from the web either. – Ragul Parani Jul 16 '21 at 09:57
  • you can also open a support case via http://support.microsoft.com to contact Microsoft support team. – samwu Jul 19 '21 at 07:34
  • You might want to take a look at the solution of https://stackoverflow.com/questions/69628186/ . – slowhand Mar 04 '22 at 19:12

0 Answers0