jeudi 4 juin 2015

ember-cli assets not loading rails 4

I have a page was requesting 'assets/ember/scalus-services.js'. These assets did not exist, since the assets are built by Ember CLI with an MD5 fingerprint

i.e - 'ember/assets/scalus-services-000aaa111222eee333333111222eee33.js'

Hence I received:

Failed to load resource: the server responded with a status of 404 (Not Found)

When using asset helpers like asset_path, this path is resolved one of three ways

  1. It looks it up in manifest-.json (loaded into memory as Rails.application.assets) under the 'assets' object. the assets object is basically the path you would pass into a helper like 'ember/scalus-services.js' is the key and the fingerprinted file name is the value. This value includes the cloudfront prepended path (which is set in the Brocfile.js) and the rails asset path ('assets/')

  2. If the file is not found in the manifest file, it will search the asset paths in rails for the file

  3. If it isn't found in the rails asset paths, the path is served as is

The problem though is that all servers had a manifest file with the correct entries in 'public/assets'. Yet it served the path up as is.

This leads me to believe that this is a bug with sprockets or perhaps the deploy process.

HOWEVER: This bug didn't happen immediately after deployment. It started 12 hours after I deployed.




Aucun commentaire:

Enregistrer un commentaire