Uncaught SyntaxError: Unexpected token '<' (at swagger-ui-bundle.js:1:1)

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Hi I use @nestjs/swagger^6.0.4, and when I want to see the swagger’s page, I got this errors Uncaught SyntaxError: Unexpected token '<' (at swagger-ui-bundle.js:1:1) Uncaught SyntaxError: Unexpected token '<' (at swagger-ui-standalone-preset.js:1:1) Uncaught ReferenceError: SwaggerUIBundle is not defined at window.onload (swagger-ui-init.js:210:7)

I don’t know why, it works until two days ago, and I didn’t change anything in my code.

Minimum reproduction code

https://github.com/smartmakran/backend

Steps to reproduce

No response

Expected behavior

show the swagger’s page

Package version

6.0.4

NestJS version

8.2.1

Node.js version

16.13.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alifakoorcommented, Jul 26, 2022

@alifakoor please provide step-by-step instructions on how to reproduce the issue, it’s not clear how to use min reproduction repo you provided

I had a stupid mistake, it’s ok right now. thanks.

0reactions
alifakoorcommented, Sep 22, 2022

@alifakoor please provide step-by-step instructions on how to reproduce the issue, it’s not clear how to use min reproduction repo you provided

I had a stupid mistake, it’s ok right now. thanks.

I’m stupid too. I have the same problem. How did you solve it?

I had a mistake in my route name

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught SyntaxError: Unexpected token ... - GitHub
After installing on server got: Uncaught SyntaxError: Unexpected token '<' Uncaught ReferenceError: SwaggerUIBundle is not defined at ...
Read more >
Swagger UI not fetching resources (Uncaught SyntaxError
On Chrome, UI stops in "fetching resource list" message, and this error in developers console: "Uncaught SyntaxError: Unexpected token". Network tab:.
Read more >
Uncaught SyntaxError: Unexpected token : - Stack Overflow
I was getting: Uncaught SyntaxError: Unexpected token < and the error was pointing to this line in my ajax success statement: var total...
Read more >
SyntaxError: Unexpected token < in JSON at position 0
Im trying to get a single object from the api, it worked fine for other pages but for some reason it doesnt work...
Read more >
MDVA-44887: 'Uncaught SyntaxError: Unexpected token ...
The *Uncaught SyntaxError: Unexpected token const* error is displayed in the Admin panel. This patch is available when the [Quality Patches ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found