OpenMRS JavaScript Ecosystem
  1. OpenMRS JavaScript Ecosystem
  2. OMRSJS-18

To resolve runtime errors while including AngularJs library in the owa generator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Component/s: None
    • Labels:
    • Complexity:
      Undetermined

      Description

      After selecting the "AngularJs" library in the OWA generator, it successfully creates / generates all the required files needed to build a webapp (scaffolding) in the particular directory. It also doesn't show any building or deploying errors. But at the time of selecting the particular webapp from the owa module (in the openmrs running instance), it gives a blank page showing errors in the console window. These errors are to be removed.

      Reference link : https://docs.angularjs.org/error/$injector/unpr?p0=undefined

      The error text is shown below :

      vendor.bundle.js:33519 WARNING: Tried to load angular more than once.
      vendor.bundle.js:5068 Uncaught Error: [$injector:unpr] Unknown provider: $$HashMapProvider <- $$HashMap <- $$animateQueue <- $animate <- $compile <- $$animateQueue
      http://errors.angularjs.org/1.6.4/$injector/unpr?p0=%24%24HashMapProvider%2…eQueue%20%3C-%20%24animate%20%3C-%20%24compile%20%3C-%20%24%24animateQueue
      at vendor.bundle.js:184
      at vendor.bundle.js:4907
      at Object.getService [as get] (vendor.bundle.js:5062)
      at vendor.bundle.js:4912
      at getService (vendor.bundle.js:5062)
      at injectionArgs (vendor.bundle.js:5087)
      at Object.invoke (vendor.bundle.js:5113)
      at vendor.bundle.js:4913
      at getService (vendor.bundle.js:5062)
      at injectionArgs (vendor.bundle.js:5087)

        Gliffy Diagrams

          Activity

          Hide
          Pascal Brandt added a comment -

          Hi Ankit Kumar,

          Can you please include the error text/stack trace in the ticket description? In general, try to be as detailed as you can in ticket descriptions. Saying "some issue" doesn't help somebody fix the error.

          Have you tested that the error is actually fixed in the master branch?

          Cheers,
          Pascal

          Show
          Pascal Brandt added a comment - Hi Ankit Kumar , Can you please include the error text/stack trace in the ticket description? In general, try to be as detailed as you can in ticket descriptions. Saying "some issue" doesn't help somebody fix the error. Have you tested that the error is actually fixed in the master branch? Cheers, Pascal
          Hide
          Ankit Kumar added a comment -

          Hii
          Actually, I got your words wrong, I just pre assumed that its fixed at the master branch without even testing it. Now, I tested it locally by cloning it and found that the issue persists in the master branch too !!
          I regret for my premature decision of creating an issue without testing it properly !!
          I just cancelled that issue !!

          Show
          Ankit Kumar added a comment - Hii Actually, I got your words wrong, I just pre assumed that its fixed at the master branch without even testing it. Now, I tested it locally by cloning it and found that the issue persists in the master branch too !! I regret for my premature decision of creating an issue without testing it properly !! I just cancelled that issue !!
          Hide
          Ankit Kumar added a comment -

          Pascal Brandt Darius Jazayeri Hii...Can I get some help regarding how can I proceed in order to fix this bug ?
          Because it will be a blocker in my path as I will be basically working on AngularJs during my coding period !

          Show
          Ankit Kumar added a comment - Pascal Brandt Darius Jazayeri Hii...Can I get some help regarding how can I proceed in order to fix this bug ? Because it will be a blocker in my path as I will be basically working on AngularJs during my coding period !
          Hide
          Pascal Brandt added a comment -

          I don't know the solution to this off the top of my head. What have you found in your investigation so far Ankit Kumar?

          Maybe Tomasz Marzeion or Adam Grzybkowski saw this when they were working on the code recently?

          /cc Rafal Korytkowski

          Show
          Pascal Brandt added a comment - I don't know the solution to this off the top of my head. What have you found in your investigation so far Ankit Kumar ? Maybe Tomasz Marzeion or Adam Grzybkowski saw this when they were working on the code recently? /cc Rafal Korytkowski
          Hide
          Ankit Kumar added a comment -

          Pascal Brandt Haven't done much investigations so far due to my end term examinations. I got some time in between my exams so I was just going through all ur comments on the proposal and was examining angular docs to find some answer to this issue !!
          I will try to fix this issue after 1st of june (in the coding period) after my exams !!

          Show
          Ankit Kumar added a comment - Pascal Brandt Haven't done much investigations so far due to my end term examinations. I got some time in between my exams so I was just going through all ur comments on the proposal and was examining angular docs to find some answer to this issue !! I will try to fix this issue after 1st of june (in the coding period) after my exams !!
          Hide
          Ankit Kumar added a comment - - edited

          Pascal Brandt link to my pull request : https://github.com/psbrandt/generator-openmrs-owa/pull/25

          The main thing which bothered me during this error was the browser cache (worst thing)
          Before sending my first PR, it took me around 4 hrs just to check that whats the problem with yr solution because even after applying angular-animate dependency, it was continuously showing the same error !!

          And then thanks to the " Incognito Window " which ensured that the solution is correct ! ( I then slept with peace )

          Show
          Ankit Kumar added a comment - - edited Pascal Brandt link to my pull request : https://github.com/psbrandt/generator-openmrs-owa/pull/25 The main thing which bothered me during this error was the browser cache (worst thing) Before sending my first PR, it took me around 4 hrs just to check that whats the problem with yr solution because even after applying angular-animate dependency, it was continuously showing the same error !! And then thanks to the " Incognito Window " which ensured that the solution is correct ! ( I then slept with peace )
          Hide
          Pascal Brandt added a comment -

          Ankit Kumar, you may want to try this: https://stackoverflow.com/a/7000899. Then cache will be disabled whenever you have devtools open.

          Show
          Pascal Brandt added a comment - Ankit Kumar , you may want to try this: https://stackoverflow.com/a/7000899 . Then cache will be disabled whenever you have devtools open.
          Hide
          Ankit Kumar added a comment -

          Pascal Brandt That's cool ! B)

          Show
          Ankit Kumar added a comment - Pascal Brandt That's cool ! B)

            People

            • Assignee:
              Ankit Kumar
              Reporter:
              Ankit Kumar
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development