question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`generateAssetMap` must be `true` in app ember-cli-build.js

See original GitHub issue

I 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:

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kratiahujacommented, Jun 15, 2017

Fix is already in PR.

0reactions
kratiahujacommented, Jun 15, 2017

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 be true by default. We already had an error if it didn’t generate it but it was set to warning.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found