You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Racing condition for copy of constant file when transpiling client code #1830
Used the above configuration but think this should apply for all Gulp and TypeScript flavors.
Using the above configuration all tests pass but running gulp serve gives you an error indicating that the appName.constant.js file is missing. Error can be observed when trying to access the served page outputting the following to the developer console:
Uncaught Error: [$injector:modulerr]FailedtoinstantiatemodulekarmaProjectAppdue to:
Error: [$injector:modulerr]FailedtoinstantiatemodulekarmaProjectApp.authdue to:
Error: [$injector:modulerr]FailedtoinstantiatemodulekarmaProjectApp.constantsdue to:
Error: [$injector:nomod]Module'karmaProjectApp.constants'isnotavailable!Youeithermisspelledthemodulenameorforgottoloadit.Ifregisteringamoduleensurethatyouspecifythedependenciesasthesecondargument.http://errors.angularjs.org/1.5.5/$injector/nomod?p0=karmaProjectApp.constants//and much more
Underlying problem is the following:
The task copy:constant copies the constant file. This however relies on that the constant file has been created by the task constant. Where the only task that uses copy:constant is the task transpile:client, which loads task constant in parallel with copy:constant, particularly being written before in the parallel order. A racing condition is thus present where constant needs to finish faster than copy:constant can begin.
Think the constant task was either loaded faster or was somehow run ahead of the transpile:client task in some previous commit. Either way the constant task should be a dependency of task copy:constant.
Activity
fix(gulp): fix racing condition for copy:constant