Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Good day!

I am facing an issue with my .net web app. I am working on an app with 2 modules that existed for a long time. I'm using angularJS and typescript for frontend. For reasons, 1 of these modules had to be disabled.

This has created an issue where I get the following error:
TypeScript
"Error: [$injector:unpr] Unknown provider: UploadBaseProvider <- UploadBase <- hourLimitService".

I have noticed that the UploadBase is used by "ng file upload" and the lib folder containing this is located within the module solution which has been disabled.

What I have tried:

I have tried to do the following but it didn't fix the issue at all:

I made a copy of the folder with the library and moved it to a similar path as it was located in the disabled module.
I have installed the library itself into the whole project through the Nuget package manager, I rebuilt the project but non of this fixed the problem.
I am still getting the same unknown provider message. So it doesn't seem to be detecting the uploadbaseProvider at all.

I have also included importing the files to the csproj folder of the module as follows(in correct groups as it was done in the other module's csproj file):
 <Content Include="app\lib\ng-file-upload\data-url.js" />
    <Content Include="app\lib\ng-file-upload\drop.js" />
    <Content Include="app\lib\ng-file-upload\exif.js" />-

-
-
-
<pre> 
<None Include="app\lib\ng-file-upload\FileAPI.min.js.map" />
<None Include="app\lib\ng-file-upload\ng-file-upload-all.min.js.map">
     <DependentUpon>ng-file-upload-all.min.js</DependentUpon>
</None>



Can someone please let me know what is possible to do and how to fix the issue? I am willing to expand with extra information if requested.
Thank you.
Posted
Updated 22-Mar-24 2:37am
v2

1 solution

I am not an Angular developer. However, you have a Dependency Injection error according to: [$injector:unpr]. Googling you error message Error: [$injector:unpr] Unknown provider[^] confirms this. Check the links in the search results for more information.

You need to identify which module that is required and inject it where it is required.
 
Share this answer
 
Comments
xTMx9 25-Mar-24 5:16am    
I have searched for the error before and found many ways to fix this error but none worked. I tried again and found a hint in one of the searches from your link. The fix was simply to add the ngFileUpload to the app.ts file in the other used module. That fixed the problem.
Thank you.
Graeme_Grant 25-Mar-24 5:22am    
Glad I could help! 😊

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900