Open Closed

Errors on deployed application - Urgent #6194


1
exlnt created

I just published my AspNetZero V6.3 application to my domain. For the most part everything is working well.

All of my "create" modals along with the AspNetZero "create" modals are working. The issue are coming up on every single "actions" button on every single index view. I am unable to "edit" anything in the entire application. The language dropdown also throws errors.

I am also unable to get the UI customization changes to work fully. That also is throwing some error and not rendering the UI properly.

There are just so many errors being reported in the chrome console. Shown below are just a few.

Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector.
    at Object.getSelectorFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:1912)
    at Function.n._getParentFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:25437)
    at Function.n._clearMenus (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24832)
    at n.f.toggle (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:21299)
    at HTMLButtonElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:23280)
    at HTMLButtonElement.dispatch (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:50792)
    at HTMLButtonElement.a.handle (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:48811)
app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector.
    at Object.getSelectorFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:1912)
    at Function.n._getParentFromElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:25437)
    at n.f._getMenuElement (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:23492)
    at new n (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:21015)
    at HTMLAnchorElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24504)
    at Function.each (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:15094)
    at i.fn.init.each (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:13755)
    at i.fn.init.n._jQueryInterface [as dropdown] (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:24428)
    at HTMLAnchorElement.<anonymous> (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:55:26632)
    at HTMLDocument.dispatch (http://tenant1.mysite.com/view-resources/Areas/MyApp/Views/_Bundles/app-layout-libs.min.js?v=YKgjp5BlNUTo2a5mnEjTkSPg72ROhYBZL8NUo_-FJcY:15:50792)
Roles:1 Refused to apply style from 'http://tenant1.mysite.com/Error?statusCode=404' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
DevTools failed to parse SourceMap: http://tenant1.mysite.com/lib/@aspnet/signalr/dist/browser/signalr.min.js/signalr.min.js.map

Can you please let me know what I should check and/or what could be the source of the error? I dont get any of these errors on my desktop in my development environment.


36 Answer(s)
  • 0
    exlnt created

    Today I ran the desktop app and the hosted app side by side in chrome. I still cannot figure out what is missing on the hosted app? Here is an image from the chrome console, showing the exact line of JS where the error is thrown, on the hosted app. This happens on every single "Actions" button click and on the "language" dropdown on the top nav menu. The user dropdown, the notification dropdown and a custom dropdown for my app that are on the top nav all work just fine.

    JS_Error_ChromeConsole.png

  • 0
    exlnt created

    Update: I found this thread on this forum, which reports the exact same error I'm getting on the UI customization option. So I ran the AspNetZero supplied powershell script on my desktop to publish the application. Even after that, I am still getting the same errors on my published sites.

    One other note, I went through all of your documents and looked at all the notes related to "publishing" and your documents fail to mention anything about running the PS script?

  • 0
    exlnt created

    Today, I copied the _bundles folder from my desktop to my hosted app and that has resolved the actions button and language dropdown errors.

    The "mime" error still happens on the UI customization functionality.

    I would like to know why the bundles folder is not getting properly deployed and how I can resolve that issue.

  • 0
    ryancyq created

    Hi, assuming you are using v6.3 of ANZ MVC jQuery version, were you tring to deploy to Azure or Self-hosted server?

    For Azure, https://docs.aspnetzero.com/documents/zero/latest/Step-by-step-publish-to-azure-core-mvc#publish-web-mvc-application-to-the-azure

    For Self-hosted, https://docs.aspnetzero.com/documents/zero/latest/Step-by-step-core-publish-to-iis#publishing-web-site

  • 0
    exlnt created

    @ryancyq - My app is hosted on windows server. My hosting provider does not allow me to create sites via IIS manager. So I cannot follow all the steps in the document you shared. I have deployed multiple versions of ANZ Core MVC versions to this hosting site without any issues. If the support team can help me resolve the bundles issue and the MIME error that would be very heplful. Thanks!

  • 0
    exlnt created

    This problem is now happening on my desktop on my "master" branch repo code. I do all my work on my "development" fork and then merge via pull request into my "master" for deployments. Today I completed my pull request into "master" and was just trying to build and run a sanity test on the "master" fork code on my desktop and I'm getting the same errors from my original post. I cleaned the solution, run npm create-bundles multiple times and I still get the errors. The actions buttons are all broken again, on my desktop!

  • 0
    ismcagdas created

    Hi @exlnt, is this the same problem with https://support.aspnetzero.com/QA/Questions/6202 ?

    If so, we can try to help you via remove connection.

  • 0
    exlnt created

    Yes I have the same problem. I responded on that thread.

  • 0
    ismcagdas created

    Do you see an error when you run "npm run create-bundles" using command prompt in the root directory of MVC project ?

    Thanks.

  • 0
    exlnt created

    No I do not get any errors on that command.

  • 0
    exlnt created

    Ok, amazingly this morning, without me making any changes, the UI changes are working without any errors at all! This issue is resolved for today. I will reopen, if it occurs again.

  • 0
    exlnt created

    I spoke too soon! It just broke again. The issue and error comes up from the visual settings page. As you change the UI from "Default" to any of the other ones. The below files are showing as "cancelled". It renders most of the UI but it does not look the finished Metronic design.

    HostedApp_UI_Customize_NetworkLog.JPG

    HostedApp_UI_Customize_ConsoleLog.JPG

  • 0
    alper created

    mime type error is not the reason but the result. There must be some other exceptions and the client is getting an error html rather than an expected CSS. see the logs.txt for the underhood exception.

  • 0
    exlnt created

    I tested the app today and the error happened again. I pulled the logs from the site as you suggested. The entire log file is too large to post. So I have pulled out the snippet of the log file (below) at the time the MIME error occurs and it throws the 404 error in the browser console.

    INFO  2018-12-27 08:19:45,779 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://tenant1.mydomain.com/Profile/GetProfilePicture?t=636814955848306565  
    INFO  2018-12-27 08:19:45,784 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetProfilePicture", controller = "Profile", area = ""}. Executing action EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc)
    INFO  2018-12-27 08:19:45,784 [10   ] uthorization.DefaultAuthorizationService - Authorization was successful.
    INFO  2018-12-27 08:19:45,785 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc) - Validation state: Valid
    INFO  2018-12-27 08:19:45,788 [17   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.VirtualFileResult in 2.56ms.
    INFO  2018-12-27 08:19:45,789 [17   ] Infrastructure.VirtualFileResultExecutor - Executing Microsoft.AspNetCore.Mvc.VirtualFileResult, sending file 'Common\Images\default-profile-picture.png' with download name '' ...
    INFO  2018-12-27 08:19:45,790 [17   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc) in 5.5901ms
    INFO  2018-12-27 08:19:45,790 [17   ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 10.8957ms 200 image/png
    INFO  2018-12-27 08:19:45,928 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://tenant1.mydomain.com/Error?statusCode=404  
    INFO  2018-12-27 08:19:45,933 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Error", area = ""}. Executing action EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc)
    INFO  2018-12-27 08:19:45,933 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc) with arguments (404) - Validation state: Valid
    INFO  2018-12-27 08:19:45,934 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.ViewResult in 0.0138ms.
    INFO  2018-12-27 08:19:45,934 [10   ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executing ViewResult, running view Error404.
    INFO  2018-12-27 08:19:45,935 [10   ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executed ViewResult - view Error404 executed in 1.7207ms.
    INFO  2018-12-27 08:19:45,935 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc) in 2.4587ms
    INFO  2018-12-27 08:19:45,935 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 7.7351ms 200 text/html; charset=utf-8
    INFO  2018-12-27 08:19:45,973 [21   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://tenant1.mydomain.com.com/Profile/GetProfilePicture?t=636814955848306670  
    INFO  2018-12-27 08:19:45,978 [21   ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetProfilePicture", controller = "Profile", area = ""}. Executing action EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc)
    INFO  2018-12-27 08:19:45,978 [21   ] uthorization.DefaultAuthorizationService - Authorization was successful.
    INFO  2018-12-27 08:19:45,979 [21   ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc) - Validation state: Valid
    INFO  2018-12-27 08:19:45,980 [22   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://tenant1.mydomain.com.com/AbpServiceProxies/GetAll?v=636814954953712630  
    INFO  2018-12-27 08:19:45,982 [21   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.VirtualFileResult in 2.5307ms.
    INFO  2018-12-27 08:19:45,983 [21   ] Infrastructure.VirtualFileResultExecutor - Executing Microsoft.AspNetCore.Mvc.VirtualFileResult, sending file 'Common\Images\default-profile-picture.png' with download name '' ...
    INFO  2018-12-27 08:19:45,983 [17   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action EXLNT.MyApp.Web.Controllers.ProfileController.GetProfilePicture (EXLNT.MyApp.Web.Mvc) in 5.6445ms
    INFO  2018-12-27 08:19:45,984 [17   ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 10.6929ms 200 image/png
    INFO  2018-12-27 08:19:45,985 [22   ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "GetAll", controller = "AbpServiceProxies", area = ""}. Executing action Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore)
    INFO  2018-12-27 08:19:45,985 [22   ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore) with arguments (Abp.AspNetCore.Mvc.Proxying.ApiProxyGenerationModel) - Validation state: Valid
    INFO  2018-12-27 08:19:45,993 [22   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore), returned result Microsoft.AspNetCore.Mvc.ContentResult in 7.0616ms.
    INFO  2018-12-27 08:19:45,993 [22   ] Mvc.Infrastructure.ContentResultExecutor - Executing ContentResult with HTTP Response ContentType of application/x-javascript
    INFO  2018-12-27 08:19:45,993 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action Abp.AspNetCore.Mvc.Proxying.AbpServiceProxiesController.GetAll (Abp.AspNetCore) in 8.481ms
    INFO  2018-12-27 08:19:45,993 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 12.7545ms 200 application/x-javascript
    INFO  2018-12-27 08:19:46,027 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://tenant1.mydomain.com.com/Error?statusCode=404  
    INFO  2018-12-27 08:19:46,033 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Route matched with {action = "Index", controller = "Error", area = ""}. Executing action EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc)
    INFO  2018-12-27 08:19:46,034 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executing action method EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc) with arguments (404) - Validation state: Valid
    INFO  2018-12-27 08:19:46,034 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action method EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc), returned result Microsoft.AspNetCore.Mvc.ViewResult in 0.0115ms.
    INFO  2018-12-27 08:19:46,034 [10   ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executing ViewResult, running view Error404.
    INFO  2018-12-27 08:19:46,036 [10   ] Core.Mvc.ViewFeatures.ViewResultExecutor - Executed ViewResult - view Error404 executed in 1.6454ms.
    INFO  2018-12-27 08:19:46,036 [10   ] ore.Mvc.Internal.ControllerActionInvoker - Executed action EXLNT.MyApp.Web.Controllers.ErrorController.Index (EXLNT.MyApp.Web.Mvc) in 2.5635ms
    INFO  2018-12-27 08:19:46,036 [10   ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 8.8294ms 200 text/html; charset=utf-8
    
  • 0
    exlnt created

    @ismcagdas - This issue is still open and recurring issue on my deployed application. Is there any solution to this issue?

  • 0
    ismcagdas created

    Hi @exlnt

    Probalby the files I have marked in red in the screenshot below doesn't exist in your app. So, you need to find their not minified verison in your project, right click on the file and minify it using the Bundler & Minifier visual studio extension.

    image.png

    Or you can manually add a bundle config into bundleconfig.json in your MVC project. After doing that, you need re-publish your app.

  • 0
    exlnt created

    @ismcagdas - I just checked my solution and I only see the files shown in the image below, they are CSS and LESS files. The LESS files dont provide the option to "Bundle and Minify", when I right click them.

    Metronic-Customize_Files_VS_2019-01-02.JPG

    Do I need to manually "Bundle and Minify" the CSS files? They are already part of the bundle, as shown below.

      {
        "outputFileName": "wwwroot/view-resources/Areas/MyApp/Views/_Bundles/common-styles.css",
        "inputFiles": [
          "wwwroot/Common/Styles/**/*.css",
          "wwwroot/fonts/fonts-poppins.css",
          "wwwroot/fonts/fonts-roboto.css",
          "!wwwroot/Common/Styles/**/*.min.css",
          "!wwwroot/Common/Styles/Themes/**/*.css",
          "!wwwroot/Common/Styles/abp-zero-template-rtl.css",
          "!wwwroot/Common/Styles/metronic-customize-top-menu*.css"
        ]
      },
    
  • 0
    ryancyq created

    Have you installed https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BundlerMinifier on your VS studio?

  • 0
    exlnt created

    Yes I have that installed from a long time ago.

    One additional note, in my source code the "theme2" LESS and CSS files are both empty. This is how its been since I downloaded the solution from AZN. A couple of the other themes are like that too, but all themes work locally on my desktop without any issues.

  • 0
    ismcagdas created
  • 0
    exlnt created

    @ismcagdas - The LESS and CSS files for some of the themes are completely empty. I already have the web compiler installed. Can you confirm if some of the metronic themes have empty LESS & CSS files or is my solution missing something? If something is missing, then how is it that the ALL of the theme UI changes work just fine in my local development environment. The issues only appear on the hosted/deployed app.

  • 0
    ismcagdas created

    @exlnt

    When you publish your app *.min.css files are used but on local environment *.css files are used. If you run your app using production environment locally, you will see the same problem.

    Yes, I can see that there are empty less files under theme2.

  • 0
    exlnt created

    @ismcagdas - Thanks! Your last post was helpful. I ran my local environment with "staging" settings file and the error occurred on those two files. However, source .LESS and .CSS files under theme2 and theme8 are empty. So how can I create .min versions of those files?

  • 0
    ismcagdas created

    @exlnt

    I think it is better to remove them from related _Layout.cshtml files since they are empty. We will do the same in AspNet Zero.

  • 0
    exlnt created

    @ismcagdas - I dont see how removing the empty files will resolve my original issue with the mime/404 error?

  • 0
    ukocabicak created

    @exInt Did you find a way to solve the problem?

    I have the exact same

    Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector.

    error all over the place.

    I have it on both 6.4 MVC Core project and an MVC Core 5.6 version which was running just fine for months on docker container. Just messed up after new build after merge.

    @ismcagdas Is this related with unbundled javascript/css files? Do all newly created custom app page js files have to be bundled?

  • 0
    pointlevel created

    Also got the exact same problem with errors on a complete new installation of 6.4 MVC Core.

  • 0
    exlnt created

    @ukocabicak - I solved the error on the actions and button dropdowns by replacing the "_bundles" folder with my local desktop copy. I'm still living with the UI customization error, that's why this thread is still open.

  • 0
    ismcagdas created

    @exlnt Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues/new ?

  • 0
    exlnt created

    @ismcagdas - When I tried to enter the issue, it showed me this one. Does that fix apply to my version and do you still want me to enter a new issue?

  • 0
    pointlevel created

    https://github.com/aspnetzero/aspnet-zero-core/issues/2085

  • 0
    deventerprise created

    @exInt: to fix the missing customzations issue in the release build you'll need to add the files to the bundle config, seems like someone missed this configuration: https://support.aspnetzero.com/QA/Questions/6282#answer-79e97d62-653d-e621-96cc-39eb621f2e19

  • 0
    ismcagdas created

    @exlnt yes, please create a new one.

    Thanks,

  • 0
    clintoncherry created

    FYI: Just today I had the issue "Uncaught DOMException: Failed to execute 'querySelector' on 'Document': 'javascript:;' is not a valid selector."

    • to fix this I ended up running "npm run full-build" which ended up sorting out the issue.
  • 0
    exlnt created

    @ismcagdas - I have opened new issue # 2104

  • 0
    exlnt created

    @clintoncherry - I tried your suggestion today, when I was deploying an update to my hosted app. It did not make any difference. After publishing both errors that I reported in my original post still happened.