Updated CSS Stylesheet not loaded following deployment to Heroku?
It looks like you have added assets precompiled file in your git repo. Ideally, it shouldn't be there since heroku can do this for you whenever you push
it.
To fix this, you have to do this
git rm -r public/assets/
- add
public/assets/**
in your.gitignore
file git add .
git commit -am "allow heroku auto assets precompilation"
git push heroku master
Heroku CSS file not updating
I was having the same problem with Django on heroku. After following the standard git add, commit, push loop - the server's CSS was not updating. Everything, including static files, had been pushed to the server.
Restarting the heroku server worked though:
heroku restart
Give that a go!
Why my css file is not loading when deployed in heroku? P.S: I'm using ejs
After rigorous research and trying so many ways finally I'm able to resolve my issue by myself.
I have done some major changes, and my issue was resolved.
I have changed my file structure a little bit.
From this to this
I have created a new directory called partials in the views directory and moved my header.ejs and footer.ejs files to that directory.
In header.ejs file I have changed the code from this
<link href="css/styles.css" rel="stylesheet" type="text/css" >
to
<link href="/css/styles.css" rel="stylesheet" type="text/css" >
In other .ejs files I have included the header.ejs and footer.ejs as follows:
<%- include("partials/header"); -%>
<%- include("partials/footer"); -%>
And that's how I am able to solve my issue.
Hakuna Matata
css stylesheet not applied when it is deployed in heroku.but works in localhost node.js
Your public folder is named "Public" while you're passing public
(with lowercase p
) to express.static()
. Rename your folder to exactly match the code and try again.
Removed Stylesheet from application but it still appears on Heroku
You will have to do a couple of more steps:
$ rake assets:precompile
$ git add .
$ git commit
... deploy to heroku
rake assets:clean
just removes the compiled assets locally; without running the precompile step to generate new assets, the assets on heroku does not get refreshed.
Related Topics
Removing Page Scrollbars in IE8 (Overflow:Hidden Not Working)
Position: Sticky (Firefox) on a <Table> Element
How to Make Chosen Select Go Over Parent Div
How to Create a Sidebar and Content Area Using Flexbox
Should I Remove Vendor Prefixes
How Does Internet Explorer 8 Support the CSS Outline Attribute
Less Inheritance Fails with "Undefined Class"
Sass --Watch with Automatic Minify
Bootstrap Fullscreen Layout with 100% Height
IE8 Doesn't Zoom Content When Applying a CSS Zoom Value to a Div
Chrome and It's Handling of %S
Gmail Responsive Email - Media Queries - Style Tag
Add a Rule to an Element Only If It Has a Certain Child