Base solution for your next web application
Open Closed

Login page not loading #7566


User avatar
0
OriAssurant created

Browser console shows that GET https://api.alservices.com/AbpUserConfiguration/GetAll?d=1567102056688 call fails with net::ERR_FAILED

network tab

Environment

ASP.NET Core Angular v7.1.0 .Net Core 2.2 Windows 10 Chrome Version 76.0.3809.100 (Official Build) (64-bit) Node v10.15.0 IIS 10.0.17134.1

Host appsettings.json

"App": {
    "ServerRootAddress": "https://api.alservices.com/",
    "ClientRootAddress": "http://{TENANCY_NAME}.alservices.com:81/",
    "CorsOrigins":http://alservices.com:81,http://localhost:49152,
                    http://*.alservices.com:81",
    "SwaggerEndPoint": "/swagger/v1/swagger.json",
    "AllowAnonymousSignalRConnection": "true"
  },

Observations

No errors are present in host log files, AbpUserConfiguration/GetAll executes successfully.

Question

  1. Why are we getting a "net::ERR_FAILED" error in Chrome?
  2. Why are pages not loading?

12 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Please share your CORS configuration as shown below.

  • User Avatar
    0
    OriAssurant created
    //Configure CORS for angular2 UI
                services.AddCors(options =>
                {
                    options.AddPolicy(DefaultCorsPolicyName, builder =>
                    {
                        //App:CorsOrigins in appsettings.json can contain more than one address with splitted by comma.
                        builder
                            .WithOrigins(
                                // App:CorsOrigins in appsettings.json can contain more than one address separated by comma.
                                _appConfiguration["App:CorsOrigins"]
                                    .Split(",", StringSplitOptions.RemoveEmptyEntries)
                                    .Select(o => o.RemovePostFix("/"))
                                    .ToArray()
                            )
                            .SetIsOriginAllowedToAllowWildcardSubdomains()
                            .AllowAnyHeader()
                            .AllowAnyMethod()
                            .AllowCredentials();
                    });
                });
    
  • User Avatar
    0
    maliming created
    Support Team

    @oriassurant

    Can I take a look at it remotely? Please send teamviewer information to [email protected]

  • User Avatar
    0
    OriAssurant created

    @maliming

    Please let me know when you are available for a session

  • User Avatar
    0
    maliming created
    Support Team

    We can remote now.

  • User Avatar
    0
    OriAssurant created

    Hello, Please join the video call, by clicking on this link: https://go.teamviewer.com/v14/m86284895 Meeting ID: m86-284-895

  • User Avatar
    0
    maliming created
    Support Team

    Please share your ID and password by email

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @oriassurant

    Have you checked server-side log file ? Most of the time, CORS issues on Angular app are misleading. So, this might be something related to a server side error.

  • User Avatar
    0
    maliming created
    Support Team

    @ismcagdas Found the problem remotely. @oriassurant is working on it.

  • User Avatar
    1
    drenton created

    I created the same issue before and the issue seems to be from Chrome.

    https://support.aspnetzero.com/QA/Questions/7529

  • User Avatar
    0
    OriAssurant created

    Why was this closed?

  • User Avatar
    0
    maliming created
    Support Team

    @oriassurant

    Have you solved the problem yet? I remember that the web application responded slowly because of computer performance.