Ask coding questions

← Back to all posts
Why is the IDE preview blank?
Socked

I am making a NodeJS Express app and the preview in the IDE is blank even though I can see it in my browser.

The problem only happens if I use helmet.

Answered by xfinnbar [earned 5 cycles]
View Answer
Voters
Socked
Comments
hotnewtop
xfinnbar

You need to listen on 0.0.0.0 instead of localhost.

Socked

@xfinnbar I found the solution myself, but how do I do that on replit? Just curious.

Solution:

xfinnbar

Not a Node guy myself, but in Python Flask you use app.run("0.0.0.0") @Socked

Socked

Ohh, I’ve never used Python at all. In Node I just do

@xfinnbar

xfinnbar

Node must listen on 0.0.0.0 by default. In Python and a lot of other languages, localhost is default. @Socked