4

I have the eShopOnContainers solution here: https://github.com/dotnet-architecture/eShopOnContainers. I have been actively working on a variation of it for the last few years. I attempted to compile it this morning and the WebStatus project causes this error:

libman.json(0,0): Error LIB002: The "jquery@3.4.1" library could not be resolved by the "cdnjs" provider

I have found this: https://github.com/aspnet/LibraryManager/issues/685 and this: https://issuemode.com/issues/cdnjs/cdnjs/94570425 (updated yesterday)

So far I have tried what is suggested in the articles:

dotnet tool install -g Microsoft.Web.LibraryManager.Cli (installs version 2.1.75) libman cache clean libman restore

Is there anything else I can try? My Libman.json looks like this:

{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
    {
      "library": "jquery@3.4.1",
      "destination": "wwwroot/lib/jquery/"
    },
    {
      "provider": "unpkg",
      "library": "bootstrap@4.1.3",
      "files": [
        "dist/css/bootstrap.css",
        "dist/css/bootstrap.css.map",
        "dist/css/bootstrap.min.css",
        "dist/css/bootstrap.min.css.map",
        "dist/js/bootstrap.js",
        "dist/js/bootstrap.min.js"
      ],
      "destination": "wwwroot/lib/bootstrap/"
    }
  ]
}
w0051977
  • 15,099
  • 32
  • 152
  • 329

2 Answers2

7

Try this:

-Right click libman.json

  • Disable Client-Side libraries on build

Build the project

  • Thank you that fixed it for me. Would this have any repercussions on the deployment of the solution? – theITvideos Dec 05 '22 at 01:56
  • "Disable Client-Side libraries on build" effectively turns off libman (and this will affect things like CI/CD pipelines). I actually ran into this issue recently with Microsoft.Web.LibraryManager.Build v2.1.113, and nothing I did could fix the issue. Running libman at the command prompt worked 100%, the only resolution was to upgrade Microsoft.Web.LibraryManager.Build version to v2.1.175 in the project, and then the cdnjs provider began to resolve again. I have to assume this is something on the cdnjs side of things which required a change to the Microsoft.Web.LibraryManager.Build codebase. – Xorcist Jan 10 '23 at 00:59
1

This happened to me after installing Visual Studio 2022 because Nuget package Microsoft.Web.LibraryManager.Build was not installed. Here's what I did:

  • Right click on libman.json file and select "Disable client-side libraries on build"
  • Right click on the same file again and re-enable the option
  • Nuget will install the required package Microsoft.Web.LibraryManager.Build
  • Build the project

If Nuget fails to install it this way you can manually install it via Nuget Package Manager Console

Alexandre M
  • 1,146
  • 12
  • 23
  • 1
    I had installed Microsoft.Web.LibraryManager.Build manually, but still had problems. Using this solution however, solved the problem for me. – Liknes Apr 24 '23 at 11:09