Skip to content
Sign upLog in
← Back to Community

opening a flask server in a new tab gives chrome an error.

Profile icon
ExuDoSHacker

i have the flask server set up to use multiple pages and i need to open it in a new tab often to test these new pages. but now after opening it in a new tab chrome just says that it got an invalid response. is there something im not doing right?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
BrettHarris2
Profile icon
ExuDoS
Comments
hotnewtop
Profile icon
Coder100

Hi! That's a repl.it bug. Please report it here. Alternatively, you can also fork the repl.

Profile icon
gibbsfreenergy

It's a bug!!!

@Coder100

Profile icon
Coder100

?

@JosephSanthosh

Profile icon
PattanAhmed

@Dante_Morrison Hi,
It's a Repl.it Bug
If you want you can try by forking your Repl

But most likely it will not work.

So, Report it in Repl.it Bugs Section
Click here

That's it you can try
Thanks!

Hope this helps

Profile icon
ExuDoS

@PattanAhmed
yeah the fork doesnt appear to change anything

Profile icon
PattanAhmed

@Dante_Morrison Yes!
So,
Report it to Bugs...
Click here

Profile icon
ExuDoS

@PattanAhmed
i already reported it as a bug but its too son for them to respond to it, so now its a waiting game

Profile icon
PattanAhmed

@Dante_Morrison Good!
Happy to help you!

Please mark my answer if that helps
Thanks!

Profile icon
CodingCactus

@PattanAhmed
you just copied what
@Coder100
said again. Can you stop doing that.

Profile icon
PattanAhmed

@CodingCactus
Nope, I didn't.
Can't you see the difference?

Profile icon
CodingCactus

@PattanAhmed
I can see that you have pressed enter a few times and added some random information, but other than that is just copied.

Profile icon
PattanAhmed

@CodingCactus
ok!

smh

Profile icon
PattanAhmed

@Dante_Morrison Hi,
By looking at this example:-

from flask import Flask app = Flask('app') @app.route('/') def hello_world(): return 'Hello, World!' app.run(host='0.0.0.0', port=8080)

Having a host as 0.0.0.0 is normal.

But in your case:- You forgot to add port
So, add port thing too.
Make your line 63 like this and try

app.run(debug=True, host='0.0.0.0', port=8080)

That's it
Thanks!

Hope this helps

Profile icon
gibbsfreenergy

Still has the same problem...

@PattanAhmed

Profile icon
PattanAhmed

@JosephSanthosh
If so,
It can be a bug!

Profile icon
PattanAhmed

@JosephSanthosh
Let me post that too!

Profile icon
gibbsfreenergy

Post what?

@PattanAhmed

Profile icon
CodingCactus

@PattanAhmed
you don't need to specify a port

Profile icon
PattanAhmed

@CodingCactus
Ok!
Good!

Profile icon
gibbsfreenergy

Yes! The port for your flask server is not there. Since repl.it is an IDE of it's own it's port number is different. Under line 63 paste this code

app.run(host='0.0.0.0', port=8080)

Your flask looks pretty cool, honestly!

Hope this helped!

Profile icon
ExuDoS

@JosephSanthosh
i tried your suggestion but i got this error

OSError: [Errno 99] Cannot assign requested address
im not totally sure what it means but the other problem seems to still be persisting

Profile icon
gibbsfreenergy

Sorry I'm so sorry! It was a mistake on my side, now check this same comment. @Dante_Morrison

Profile icon
ExuDoS

@JosephSanthosh
that fixed the error, but its still not showing up in another tab

Profile icon
gibbsfreenergy

Could you try this ?

if __name__ == "__main__": app.run("0.0.0.0", 8080)

Paste this over line 63. If it doesn't work please tell me!

@Dante_Morrison

Profile icon
ExuDoS

@JosephSanthosh
it only seemed to make the preview not show up

Profile icon
gibbsfreenergy

I guess it is a bug then. Sorry! @Dante_Morrison