Uncaught SyntaxError: Unexpected token '<' in Angular 7.3 and .net 8 Application

Discussão em 'Angular' iniciado por Bob Enein, Novembro 25, 2024.

  1. Bob Enein

    Bob Enein Guest

    I recently migrated Angular/.net 8 Application from .net core 2.1 to .net 8. The application runs fine in my debug mode. However, when I deployed the application to IIS, it bombs with the 'Uncaught SyntaxError: Unexpected token '<' error.As I compared the updated application behaviour to the current one, I see that the angular built JS scripts runtime*, pollyfills*, main* and scripts* are HTML files rather than JS files. These same files in the dist folder look as JS files upon inspection. What is the cause of this? I checked the pathing of the files and the it's same angular file structure in both apps.

    Any lights shed on this is greatly appreciated.

    • Used dotnet publish command
    • Used VS 2022 publish command also to generate the deployment package to no avail.
    • Copied over dist folder with the dist folder in my machine.

    error

    Continue reading...

Compartilhe esta Página