`generateAssetMap` must be `true` in app ember-cli-build.js
See original GitHub issueI upgraded from ember-cli-fastboot 1.0.0-beta.12 to 1.0.0-rc.2. I’m using fastboot-app-server to run the app at version 1.0.0-rc.5 (unchanged).
After upgrading builds were successful, but the fastboot-app-server failed with:
Error: ENOENT: no such file or directory, open '/app/dist/assets/vendor.js'
at Error (native)
at Object.fs.openSync (fs.js:641:18)
at Object.fs.readFileSync (fs.js:509:33)
at /app/node_modules/fastboot/src/ember-app.js:141:27
at Array.forEach (native)
at EmberApp.loadAppFiles (/app/node_modules/fastboot/src/ember-app.js:139:21)
at EmberApp.retrieveSandboxedApp (/app/node_modules/fastboot/src/ember-app.js:187:10)
at new EmberApp (/app/node_modules/fastboot/src/ember-app.js:50:21)
at FastBoot._buildEmberApp (/app/node_modules/fastboot/src/index.js:114:17)
at new FastBoot (/app/node_modules/fastboot/src/index.js:52:10)
In the dist/package.json
of my app the vendorFiles
value did not have a fingerprint, but the actual production build files were of course fingerprinted.
Some debugging yielded the following:
this.assetMapEnabled
is onlytrue
ifgenerateAssetMap
istrue
for broccoli-asset-rev [source].- By
this.assetMapEnabled
beingtrue
perhaps this line would log an error instead of fail silently.
With this in mind I changed ember-cli-build.js
in my app to the following:
var app = new EmberApp(defaults, {
fingerprint: {
generateAssetMap: true
}
});
Which (kind of surprisingly?) caused my dist/package.json
to have the correct fingerprinted values. Thus fixing my server.
It seems odd that the app server must have this flag set instead of ember-cli-fastboot defaulting it? Or at the least it is undocumented?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Resolving fingerprinted assets using generateAssetMap
I set the ENV.APP.CDN_PATH in my config/environment.js by reading a JSON file that I also reuse in the ember-cli-build.js, so I don't have...
Read more >Ember.js Lazy Assets: Fingerprinting & loading static/dynamic ...
To load the assets lazily, the app must know the exact fingerprinted ... by setting the generateAssetMap to true in ember-cli-build.js file.
Read more >Ember-cli fingerprinting and dynamic assets | by Ruslan Zavacky
As you've probably noticed, we've added generateAssetMap: true, that instructs broccoli-asset-rev to generate assetMap.json in assets/ directory ...
Read more >ember.js - using the ember manifest plugin - Stack Overflow
In my ember-cli-build.js file I have: module.exports = function(defaults) { var app = new ...
Read more >ember-theme-changer - npm
To accomplish it you must define all available themes in your ... ember-cli-build.js outputPaths: { app: { css: { 'light': ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix is already in PR.
Ok finally tracked this down. #112 attempted to fix this issue but it doesn’t seem to be present in beta or rc builds. Hence apps needed to explicitly set it. I have re-introduced the fix with setting it by
generateAssetMap
to betrue
by default. We already had an error if it didn’t generate it but it was set to warning.