Sprockets::FileNotFound: couldn't find file 'jquery-ui' with type 'text/scss' when deploying a Rails 6 app to Heroku

1.3k Views Asked by At

I am struggling to deploy my Rails 6 app to Heroku - the deployment breaks with this error message:

remote:        rake aborted!
remote:        Sprockets::FileNotFound: couldn't find file 'jquery-ui' with type 'text/scss'
remote:        Checked in these paths:
remote:          /tmp/build_510d92ed/app/assets/config
remote:          /tmp/build_510d92ed/app/assets/images
remote:          /tmp/build_510d92ed/app/assets/javascripts
remote:          /tmp/build_510d92ed/app/assets/stylesheets

This is my app/assets/config/manifest.js:

//= link_tree ../images
//= link_directory ../javascripts .js
//= link application.scss
//= link custom.css
//= link vendor/slick.min.js

and is the app/assets/stylesheets/application.scss file:

/*
 *= require_self
 *= require jquery-ui
 */
 @import 'custom';

package.json:

{
  "name": "myapp",
  "private": true,
  "dependencies": {
    "@hotwired/turbo-rails": "^7.0.0-beta.5",
    "@rails/actioncable": "^6.0.0",
    "@rails/activestorage": "^6.0.0",
    "@rails/ujs": "^6.0.0",
    "@rails/webpacker": "5.2.1",
    "@tailwindcss/forms": "^0.3.2",
    "@tailwindcss/postcss7-compat": "^2.0.4",
    "autoprefixer": "^9",
    "el-transition": "^0.0.7",
    "google-maps": "^4.3.3",
    "jquery": "^3.6.0",
    "postcss": "^7",
    "stimulus": "^2.0.0",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat"
  },
  "version": "0.1.0",
  "devDependencies": {
    "webpack-dev-server": "^3.11.2"
  }
}

How do I fix this issue?

Thank you in advance.

2

There are 2 best solutions below

0
On

The solution for me was to run yarn install. Sometimes it is the little things.

0
On

For me, after upgrading to rails 7, I needed to have added sprockets, like so, then everything worked:

# Gemfile
gem "sprockets-rails"

More here