Swagger: @nest/swagger example does not work in my wsl2

Created on 22 Jul 2020  路  5Comments  路  Source: nestjs/swagger

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I tried the official working example in my wsl2. After I started the nest app and go to http://localhost:3000/api/, I clicked any route in cats tag, then the page flashed and this route went to default tag, and the current url is http://localhost:3000/api/#/default/post_cats. Then, I clicked this route, it will keep loadding like the flowing picture.

image

The nest log is:

yarn run v1.22.4
$ nest start
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [NestFactory] Starting Nest application...
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [InstanceLoader] AppModule dependencies initialized +10ms
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [InstanceLoader] CatsModule dependencies initialized +0ms
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [RoutesResolver] CatsController {/cats}: +39ms
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [RouterExplorer] Mapped {/cats, POST} route +2ms
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [RouterExplorer] Mapped {/cats/:id, GET} route +1ms
[Nest] 17403   - 07/22/2020, 3:16:25 PM   [NestApplication] Nest application successfully started +1ms
Application is running on: http://[::1]:3000

There is not log in the browser.

Expected behavior


I want to see the detailed route infomation.

Minimal reproduction of the problem with instructions

Official working example.

Environment


Nest version: 7.3.2


For Tooling issues:
- Node version: 14.5.0  
- Platform:  Windows Subsystem for Linux 2, Ubuntu-20.04, Linux 4.19.104-microsoft-standard,  Windows10 2004 

Others:

Most helpful comment

change [swagger-ui-dist version "3.30.1"] to [version "3.26.2"] can resolve this problem

All 5 comments

I have the same problem

change [swagger-ui-dist version "3.30.1"] to [version "3.26.2"] can resolve this problem

This issue is indeed related to the swagger-ui-dist. Please note that an issue is already raised on their bug tracker.

As a workaround you can leverage yarn resolutions and add the following to your package.json as stated here

...
  "resolutions": {
    "swagger-ui-dist": "3.30.0"
  }
...

Thanks to @julien-sugg @chaims .

I will pay attention to this bug tracker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Diluka picture Diluka  路  4Comments

kalaivanan-muthusamy picture kalaivanan-muthusamy  路  4Comments

otroboe picture otroboe  路  3Comments

alisherks picture alisherks  路  4Comments

KatSick picture KatSick  路  3Comments