Open Closed

Issue with ABP9 and wwwroot/libs when using APIs with Swagger #8531


User avatar
0
auxo-devsu created
  • ABP Framework version: v9.0.2
  • Database System: EF Core
  • Steps to reproduce the issue:

After I upgraded my ABP 8.0.2 to 9.0.2, when I run the .Host project it shows the message:

"The Libs folder under the wwwroot/libs directory is empty! The Libs folder contains mandatory NPM Packages for running the project.

Make sure you run the abp install-libs CLI tool command.

For more information, check out the ABP CLI documentation"

My host project is an API and I don't have a package.json file. I read on GitHub https://github.com/abpframework/abp/issues/21692 that a workaround would be to copy the 'libs' folder from AuthServer but I don't think this is acceptable as they will not be maintained over time.

Please let me know how to fix it for API projects.


9 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Could you please share the full logs? thanks.

  • User Avatar
    0
    auxo-devsu created

    Hi,

    Could you please share the full logs? thanks.

    Any of your projects with a simple API with Swagger would result in the same issue. Have you tried it? Have you reviewed the GitHub page I shared as part of my ticket?

    I can provide logs but there's not a lot to be seen other than the message I shared on my ticket.

  • User Avatar
    0
    auxo-devsu created

    Screen:

    Debug Logs:

    Please note the ERR log above. Nothing else. To make it work, I'm adding manually the /libs folder from AuthServer into my API project but this is not optimal as ABP should take care of that when I run abp install-libs which doesn't happen in this project as I don't have a package.json and don't want to have, if I'm honest.

    Please let me know what next.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Yes, I have checkd, it works for me. I guess there is a wwwroot folder under your project, you can try remove it.

  • User Avatar
    0
    auxo-devsu created

    I'm not sure if you followed what I said. Did you run an API project with Swagger? You have to keep serving the /swagger/index.html which goes under wwwroot.

    If you did follow what I said, could you please show me how I run Swagger without wwwroot?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I can't reproduce the problem with a new project abp new Testapp --tiered

    I don't know much about your project, if you can share a test project with me , I will check it. shiwei.liang@volosoft.com

  • User Avatar
    0
    auxo-devsu created

    My app is very basic. As you can tell, I use Swashbuckle, which is provided by ABP. As you can from my other posts, I'm not starting on ABP now. I'm migrating from v8 to v9.

    If you are able to open one of your v8 API projects (i.e. no UI) where you don't have a package.json and if you upgrade that to v9, you will be able to reproduce that.

    Please note that I had to manually copy the libs folder indicated below as I don't have package.json as part of my project.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You don't need wwwroot folder, the swagger files are already provided by Volo.Abp.Swashbuckle package.

    if you want to keep it, you can disable the libs check.

    Configure<AbpMvcLibsOptions>(options =>
    {
        options.CheckLibs = false;
    });
    
  • User Avatar
    0
    auxo-devsu created

    We need the swagger files in there as we are overriding the default ABP behaviour for authentication. Thanks for sharing how to disable it.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 20, 2025, 18:00