Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Swagger issue on loading an undefined resource #2695

Open
VictoriqueMoe opened this issue May 3, 2024 · 9 comments · Fixed by #2698
Open

[BUG] Swagger issue on loading an undefined resource #2695

VictoriqueMoe opened this issue May 3, 2024 · 9 comments · Fixed by #2698
Assignees

Comments

@VictoriqueMoe
Copy link

VictoriqueMoe commented May 3, 2024

Describe the bug

When i load Swagger (in Linux). i am getting some 404's on my network tab, these seem to be some sort of resource generated from an undefined.

see https://waifuvault.moe/api-docs/

image
image

Oddly enough, on my pc (Windows). when i load swagger, i don't get this, but also, i don't get the "valid" tick at the bottom right either. so not sure why it only happens when deployed on my production server

To Reproduce

  1. deploy under production
  2. load swagger page
  3. get 404 on page

Expected behavior

Loads swagger page with no errors

Code snippets

No response

Repository URL example

No response

OS

Ubuntu 23.10

Node version

v20.11.1

Library version

7.68.5

Additional context

No response

@VictoriqueMoe
Copy link
Author

It seems to be coming from the validator badge

@Romakita
Copy link
Collaborator

Romakita commented May 7, 2024

Hello @VictoriqueMoe

I finally decided to use the getAbsolutePath from swagger-ui-dist/get-absolute-path.js it seems to works correctly. I was thinking importing file directly (when exports isn't defined in the package.json of the module) doesn't works in ESM. Finally, if exports is missing, ESM can import any files in the package.

It should solve your issue ;)
See you

Copy link

github-actions bot commented May 7, 2024

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

@Romakita
Copy link
Collaborator

Romakita commented May 7, 2024

🎉 This issue has been resolved in version 7.68.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@VictoriqueMoe
Copy link
Author

Hello @VictoriqueMoe

I finally decided to use the getAbsolutePath from swagger-ui-dist/get-absolute-path.js it seems to works correctly. I was thinking importing file directly (when exports isn't defined in the package.json of the module) doesn't works in ESM. Finally, if exports is missing, ESM can import any files in the package.

It should solve your issue ;) See you

@Romakita

unfortantly, this did not solve the issue, i still get these 404's and the validator badge still errors
image
image

i deployed the latest tsed and you can see the error here: https://waifuvault.moe/api-docs/

@Romakita
Copy link
Collaborator

Romakita commented May 7, 2024

Ok. But now the path is directly get from swagger-ui-dist. So it's not related to the latest changes. Maybe the problem is related to swagger-ui-dist itself?

@Romakita
Copy link
Collaborator

Romakita commented May 7, 2024

But we can see a undefined string in the url. I'll check if other changes have introduce this regression. It's a bit complicated to repro in local when the badge is only displayed on a non localhost domain. I'll keep you informed if I found something ;)
And sorry for this unresolved issue!

@VictoriqueMoe
Copy link
Author

But we can see a undefined string in the url. I'll check if other changes have introduce this regression. It's a bit complicated to repro in local when the badge is only displayed on a non localhost domain. I'll keep you informed if I found something ;) And sorry for this unresolved issue!

yeh, it's annoying for sure that is hard to test. editing the hosts file to proxy a localhost domain worked for me.

also, no problem! it's not really a blocker. However, this is a blocker: https://github.com/orgs/tsedio/discussions/2697 if that counts for anything :D

thank you as always for your amazing support and help

@Romakita
Copy link
Collaborator

Romakita commented May 7, 2024

Ho shit missed this issue. I'll try to find a way to fix that ASAP @VictoriqueMoe ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants