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

Works only once #359

Closed
Crypt0Graphic opened this issue Feb 7, 2021 · 14 comments
Closed

Works only once #359

Crypt0Graphic opened this issue Feb 7, 2021 · 14 comments

Comments

@Crypt0Graphic
Copy link

Crypt0Graphic commented Feb 7, 2021

When i start (npm run dev) my project, i can open swagger url first time without problem:

http://localhost:3000/documentation/static/index.html

But second time it seems loading forever. I start project again but nothing changes. No error just loading...

Screen Shot 2021-02-07 at 08 55 45

Bu this works well every time:

http://localhost:3000/documentation/json

Seems like there is a problem with /static/index.html

I am using fastify 3.11.0, fastify-swagger 4.1.1. Project created by fastify-cli.

Screen Shot 2021-02-07 at 08 53 09

Screen Shot 2021-02-07 at 08 59 11

When i call that url i see 2 more node and Google at port 3000:

Screen Shot 2021-02-07 at 09 01 57

@climba03003
Copy link
Member

await fastify.swagger

should be

await fastify.swagger()

@Crypt0Graphic
Copy link
Author

Crypt0Graphic commented Feb 8, 2021

await fastify.swagger

should be

await fastify.swagger()

Both of them works. I updated but the problem still continues. In fact, I haven't even been able to open it once today. :/

@mcollina
Copy link
Member

mcollina commented Feb 8, 2021

I would recommend you to upload a repository to reproduce this problem.

@Crypt0Graphic
Copy link
Author

After fastify.swagger() update i could not open it yesterday. Today i opened but couldn't see any content. Then i change it to fastify.swagger back and it's ok. Really interesting. Both of them works but just swagger without parentheses shows content.

await fastify.swagger();

Screen Shot 2021-02-09 at 11 05 27

await fastify.swagger;

Screen Shot 2021-02-09 at 11 05 52

@Crypt0Graphic
Copy link
Author

Crypt0Graphic commented Feb 9, 2021

My App.js & Config (Swagger Options)

Screen Shot 2021-02-09 at 11 16 36

Screen Shot 2021-02-09 at 11 16 23

Btw, if i put swagger after DON'T TOUCH section, it's content is getting blank again.

@mcollina
Copy link
Member

mcollina commented Feb 9, 2021

There is likely something it was not setup correctly in your application. It's very hard to guess what is not working by looking at screenshots.

Please upload a runnable script that we can use to reproduce the problem you are facing.

@Crypt0Graphic
Copy link
Author

Crypt0Graphic commented Feb 9, 2021

There is likely something it was not setup correctly in your application. It's very hard to guess what is not working by looking at screenshots.

Please upload a runnable script that we can use to reproduce the problem you are facing.

I sent you an invite for github repository.

It's pretty simple app that is created by fastify-cli. I did not make any significant changes to the default structure, i guess.

@Crypt0Graphic
Copy link
Author

Crypt0Graphic commented Feb 9, 2021

O noticed something at terminal. Here are my 5 attempts. First 4 stuck at loading screen. Fifth is successful. As you can see there are no ...js.map, /uiConfig & /json requests at first 4. Seems like main problem is map files.

I hope this helps.

STUCK AT LOADING

failure1
failure2
Screen Shot 2021-02-09 at 12 34 29
Screen Shot 2021-02-09 at 12 35 59

SUCCESSFUL ONE

Success

@mcollina
Copy link
Member

mcollina commented Feb 9, 2021

I sent you an invite for github repository.

I am not providing private support for free. Please publish some public example to reproduce.

@Crypt0Graphic
Copy link
Author

You wanted "runnable script" and i sent you access for my real repository. Did I make a mistake? Omg. Sorry.

I wanted to show you exact code. If you think it's my problem, ok. I thought it's about library. My bad.

@mcollina
Copy link
Member

mcollina commented Feb 9, 2021

If you want somebody to help with your problem in Open Source, please produce a simple script that reproduces your problem outside of your application. This should be public and just demonstrate the problem.

While preparing that, you'd likely discover either a) what is causing the bug or b) what differences exists in your code that causes this problem.

@Crypt0Graphic
Copy link
Author

I provided too many things. How can i provide a simple script except the whole app? I have no a special script that cause problem. I just use fastify-cli project and fastify-swagger as you see. Can't imagine what you want sorry.

Nevermind, i can use it like this. Not a big problem for me. I just wanted to inform you about problem and provide some detail. I think I did it partially.

Have a nice day.

@mcollina mcollina closed this as completed Feb 9, 2021
@jsumners
Copy link
Member

jsumners commented Feb 9, 2021

Please see #337 for an example of how to ask a question that others can follow. The problem needs to be exemplified in the most narrow sense possible. Screenshots of small chunks of code and program output do not generally provide any useful information.

These questions need to be in the public eye so that anyone with knowledge can provide assistance if they so desire. Also, no one should be inspecting private code without a contract guaranteeing the rights of all parties.

We welcome bug reports. But we need them to be in a format that will help us determine the issue.

@zekth
Copy link
Member

zekth commented Feb 9, 2021

Side note, please do not provide screenshots of the code but the code itself in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants