react-rails
react-rails copied to clipboard
Css not loaded in production
Steps to reproduce
Create a .css file and import it into a .jsx file. It works locally but when pushing to heroku the css isnt loaded.
Expected behavior
Dev and prod behaves the same way
Actual behavior
Heroku does not load css and it's super annoying.
System configuration
"dependencies": { "@babel/preset-react": "^7.6.3", "@rails/actioncable": "^6.0.0-alpha", "@rails/activestorage": "^6.0.0-alpha", "@rails/ujs": "^6.0.0-alpha", "@rails/webpacker": "^4.0.7", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "css-loader": "2.1.1", "prop-types": "^15.7.2", "react": "^16.10.2", "react-dom": "^16.10.2", "react-facebook": "^8.0.4", "react-stripe-elements": "^5.0.1", "react_ujs": "^2.6.0", "turbolinks": "^5.2.0" }, "version": "0.1.0", "devDependencies": { "webpack-dev-server": "^3.8.2" }
Using ruby 2.6.0 and Rails 6.0.0
Can you precompile your assets locally? If so is your CSS file emitted at the location referred to by the stylesheet_pack_tag?
As an aside, this is likely to be a webpack or webpacker issue, doesn't sound related to this gem but I'll help if I'm able to.
Have the same issue, pushed a project to heroku that uses uppy, and the uppy css is not being included in the production version. did you ever find a solution @hugoh59 ?
Just an update if anyone googles this and needs a solution, my solution was to change stylesheet_link_tag to stylesheet_pack_tag in views/layouts/application.html.erb
Closing the issue as we have a solution for this here.