我有一个设置提供程序,可以在localhost上正常运行,但不能在IIS上运行。 AngularJS的错误是:
[$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:unpr] Unknown provider: appLevelProvider
http://errors.angularjs.org/1.6.3/$injector/unpr?p0=appLevelProvider
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:234:12
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4957:19
at getService (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5112:32)
at injectionArgs (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5137:58)
at Object.instantiate (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5183:18)
at provider (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4994:36)
at Object.provider (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4986:16)
at runInvokeQueue (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5058:35)
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5067:11
at forEach (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:570:20)
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20appLevelProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3DappLevelProvider%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A234%3A12%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4957%3A19%0A%20%20%20%20at%20getService%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5112%3A32)%0A%20%20%20%20at%20injectionArgs%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5137%3A58)%0A%20%20%20%20at%20Object.instantiate%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5183%3A18)%0A%20%20%20%20at%20provider%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4994%3A36)%0A%20%20%20%20at%20Object.provider%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4986%3A16)%0A%20%20%20%20at%20runInvokeQueue%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5058%3A35)%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5067%3A11%0A%20%20%20%20at%20forEach%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A570%3A20)
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:234:12
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4957:19
at getService (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5112:32)
at injectionArgs (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5137:58)
at Object.instantiate (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5183:18)
at provider (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4994:36)
at Object.provider (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4986:16)
at runInvokeQueue (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5058:35)
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5067:11
at forEach (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:570:20)
http://errors.angularjs.org/1.6.3/$injector/modulerr?p0=app&p1=Error%3A%20%5B%24injector%3Aunpr%5D%20Unknown%20provider%3A%20appLevelProvider%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.3%2F%24injector%2Funpr%3Fp0%3DappLevelProvider%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A234%3A12%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4957%3A19%0A%20%20%20%20at%20getService%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5112%3A32)%0A%20%20%20%20at%20injectionArgs%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5137%3A58)%0A%20%20%20%20at%20Object.instantiate%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5183%3A18)%0A%20%20%20%20at%20provider%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4994%3A36)%0A%20%20%20%20at%20Object.provider%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A4986%3A16)%0A%20%20%20%20at%20runInvokeQueue%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5058%3A35)%0A%20%20%20%20at%20https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A5067%3A11%0A%20%20%20%20at%20forEach%20(https%3A%2F%2Fengdeviis.nscorp.com%2FTRIMS_WebAPI%2Fsrc%2FBuild%2Fvendor.bundle.js%3A570%3A20)
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:234:12
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5088:15
at forEach (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:570:20)
at loadModules (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:5048:5)
at createInjector (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:4970:19)
at doBootstrap (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:2077:20)
at bootstrap (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:2098:12)
at angularInit (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:1983:5)
at https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:33508:5
at HTMLDocument.trigger (https://engdeviis.nscorp.com/TRIMS_WebAPI/src/Build/vendor.bundle.js:3603:5)
以下是settingsservice.js中的代码:
/// <reference path="../libraries/angular.js" />
/// <reference path="../libraries/extensionmethods.js" />
angular.module('app').
provider('settings', ['appLevelProvider','versionProvider', function (appLevelProvider, versionProvider) {
var appLev = appLevelProvider.$get();
var ver = versionProvider.$get();
return {
$get: function () {
(Code omitted)
}
}
}]);
我已在本地和服务器上逐步调试调试器,当本地运行时,appLevelProvider可用于cache.hasOwnProperty()以返回true。但是,在服务器上,appLevelProvider不存在。代码没有被缩小。
我错过了什么?
由于