esvg icon indicating copy to clipboard operation
esvg copied to clipboard

svgs.js not being created by asset:precompile

Open fullybaked opened this issue 7 years ago • 0 comments

We're using Rails 5.1 and have added the gem as per your instructions in the README. Our config/initializers/assets.rb is as follows

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile += %w( jquery-3.2.1.min.js )
Esvg.precompile_assets

Note, the Esvg line is included and at the bottom of the file.

When we run rails assets:precompile in a production environment (Heroku), the svgs-[fingerprint].js is not being created and thus our app is not starting.

Update It seems that the precompile step is writing the svgs.js file to the wrong location and therefore the helper can't load it in the request

remote:        Writing /tmp/build_f4d647447c24e85e80b791e7f03deed4/public/javascripts/svgs-91d4da5be527e637db9f8aadd1d09cc2.js
remote:        Writing /tmp/build_f4d647447c24e85e80b791e7f03deed4/public/javascripts/svgs-91d4da5be527e637db9f8aadd1d09cc2.js.gz

fullybaked avatar Sep 13 '17 16:09 fullybaked