Web Server has no CSS when Deployed

My Web Server wont show me CSS when deployed. The CSS shows up in sources and network of chrome dev tools. But it does not seem to show my CSS. I also have tried using other browsers and encountered the same thing.

Here is the link to my web server: https://weather-app-ln67.onrender.com/

Hi there,

This is likely a routing issue within the application. It may also be an issue where it is referencing the CSS file in the wrong directory.

Render does not block CSS files from getting loaded, so if it’s not one of the above issues you may want to consult with a community that specializes in your tech stack.

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

Weirdly, it works completely fine when I run it on my local machine. My CSS file is not in a directory, so It cant be that I am referencing it wrong.

I am not using express, and using vanilla Node.JS.

The JavaScript also works completely fine and only the CSS doesn’t work.

You can also see that my CSS is completely valid here:
https://jigsaw.w3.org/css-validator/validator?uri=https%3A%2F%2Fweather-app-ln67.onrender.com%2F&profile=css3svg&usermedium=all&warning=1&vextwarning=&lang=en

I found my solution!!:
I just needed to write a response header to specify content type…

Hi there,

There can be many differences between a local machine and an online server environment: dependencies, versions, environment variables, and various other configurations. Even code can sometimes run a bit differently when in different environments.

If you can’t find a solution soon, feel free to reach out to us privately via the Help link in the Dashboard so we can take a closer look at the service and see if anything jumps out as an issue.

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.