Base solution for your next web application
Open Closed

​NullInjectorError: StaticInjectorError[l -> l]: StaticInjectorError(Platform: core)[l -> l]: NullInjectorError: No provider for l #8811


User avatar
0
ESTeam created

Hi,

The following error only occcurs in the server (is hosted in a IIS Application), locally there is no error: main.dc1d4f39a44994907869.js:1 ERROR NullInjectorError: StaticInjectorError[l -> l]: StaticInjectorError(Platform: core)[l -> l]: NullInjectorError: No provider for l! at e.get (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:398191) at https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:466475 at e (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:466888) at e.get (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:467013) at https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:466475 at e (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:466888) at e.get (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:467013) at Tf (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:523480) at e.get (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:534377) at Tf (https://fuso.noesis.pt:11445/main.dc1d4f39a44994907869.js:1:523480)

Could you tell us how we can identify the cause of the problem? There is no error in the server, only the error that apears in the console of the Browser.

We are using ASP.NET Zero with Angular 8.2, the erro only occurs in a few components when they are loaded.

If i host the application locally in IIS the same error occurs - i copy the contents of dist folder to my site. The build is done with the command "ng build --configuration=development".

best regards, Dirceu


1 Answer(s)
  • User Avatar
    0
    ESTeam created

    Hi again,

    this problem was accidentally resolved by using a diferent build comand: instead of "ng build --configuration=development" i'm now using "npm run ng build --configuration=development"

    The command "ng build --configuration = development" does not ignore build errors and uses the environment-related configuration file in run-time, however in certain situations the components behave differently from the one verified locally (example: Errors occur only on the version installed on the server).

    It doesn't make any sense (for me at least) but it works.

    best regards, Dirceu