I am trying to deploy my app to Heroku and I keep getting stuck on this Sprockets error that a file cannot be found. I don’t understand why this is occurring.
# assets.rb
Rails.application.config.assets.paths << Rails.root.join('node_modules')
# application.js.erb
//= require rails-ujs
//= require jquery3
//= require jquery_ujs
//#= require dataTables/jquery.dataTables
//#= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require popper
//= require bootstrap
//= require activestorage
//= require turbolinks
//= require plyr
//= require lodash
//= require jquery-readyselector
//= require toastr
//= require tipso <-- throws error
I don’t understand the error because it’s clearly in my node_modules
folder.
I will say that Sprockets is searching a temporary build folder so maybe the package isn’t ending up there?:
remote: Sprockets::FileNotFound: couldn't find file 'tipso' with type 'application/javascript'
remote: Checked in these paths:
remote: /tmp/build_38841618/app/assets/config
remote: /tmp/build_38841618/app/assets/fonts
remote: /tmp/build_38841618/app/assets/images
remote: /tmp/build_38841618/app/assets/javascripts
remote: /tmp/build_38841618/app/assets/stylesheets
remote: /tmp/build_38841618/vendor/bundle/ruby/3.1.0/gems/ahoy_matey-4.0.3/vendor/assets/javascripts
remote: /tmp/build_38841618/vendor/bundle/ruby/3.1.0/gems/jquery_mask_rails-0.1.0/vendor/assets/javascripts
remote: /tmp/build_38841618/vendor/bundle/ruby/3.1.0/gems/bootstrap-tour-rails-0.4.0/vendor/assets/javascripts
remote: /tmp/build_38841618/vendor/bundle/ruby/3.1.0/gems/bootstrap-tour-rails-0.4.0/vendor/assets/stylesheets
remote: /tmp/build_38841618/vendor/bundle/ruby/3.1.0/gems/jquery-ui-rails-6.0.1/app/assets/images
...
What else can I do to get Sprockets to recognize this package?