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.

Embroider build replaces Fastboot generated package.json

See original GitHub issue

My PR - moved the implementation form the postProcessTree to treeForPublic hook. But after doing that, I noticed embroider build doesn’t add the package.json generated by ember-cli-fastboot addon. Instead, it keeps the package.json created by enbroider build in the dist folder. I am thinking some diff code is assuming the package.json generated as part of Fastboot tree is similar to package.json generated by embroider build and keeps embroider build related package.json

To Repro the issue

  1. clone -
  2. run yarn install
  3. ember s
  4. launch http://localhost:4200

page will show following error:

Error: /var/folders/tv/fgbbtzvd1f1dbv45y7r8l09m000ty_/T/broccoli-82821i0tVejhn4W1b/out-176-packager_runner_embroider_webpack/package.json was malformed or did not contain a manifest. Ensure that you have a compatible version of ember-cli-fastboot.
    at EmberApp.readPackageJSON (/Users/dnalagat/DEVELOPMENT/ember-cli-fastboot/node_modules/fastboot/src/ember-app.js:362:13)
    at new EmberApp (/Users/dnalagat/DEVELOPMENT/ember-cli-fastboot/node_modules/fastboot/src/ember-app.js:34:23)
    at FastBoot._buildEmberApp (/Users/dnalagat/DEVELOPMENT/ember-cli-fastboot/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/dnalagat/DEVELOPMENT/ember-cli-fastboot/node_modules/fastboot/src/index.js:52:10)
    at app.use (/Users/dnalagat/DEVELOPMENT/ember-cli-fastboot/index.js:318:29)
    at Layer.handle [as handle_request] (/Users/dnalagat/DEVELOPMENT/test-pemberly-bpr/test-ember/my-embroider-test/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/dnalagat/DEVELOPMENT/test-pemberly-bpr/test-ember/my-embroider-test/node_modules/express/lib/router/index.js:317:13)
    at /Users/dnalagat/DEVELOPMENT/test-pemberly-bpr/test-ember/my-embroider-test/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/dnalagat/DEVELOPMENT/test-pemberly-bpr/test-ember/my-embroider-test/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/dnalagat/DEVELOPMENT/test-pemberly-bpr/test-ember/my-embroider-test/node_modules/express/lib/router/index.js:275:10) 

This error is thrown because manifest property is missing in generated package.json.

I am thinking the fastboot generation of package.json should move to postBuild hook instead of using treeForPublic. what do you guys think @ef4 @stefanpenner @rwjblue

Related to issue - I missed this error during testing of my PR as the git repo mentioned in the above issue didn’t include fastboot and I tested assuming ember-cli-fastboot was included as dependency. 😦

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

ef4commented, May 8, 2019

Moving to postBuild won’t make compatibility with current embroider any easier. AFAIK we don’t even run that hook.

I think we should deal with this in embroider. Probably by detecting the package.json in the public tree and merging it into our own.

dnalagatlacommented, May 17, 2019

After adding the above fix in the test app I noticed following issues with Embroider+Fastboot build:

  • Missing the <app>.js file used by fastboot. - I think we may have to evaluate index.html to load all the files (vendor and app chunk JS) in the fastboot sandbox.
  • With fastboot query param set to false doesn’t load application correctly. App loads fine without fastboot as a dependency.

Investigating ^ issues. Will update here. cc: @stefanpenner @rwjblue @ef4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fastboot and embroider build failures - Build Issues
I have tried adding fastboot to my package. json, but the error is persisting. As soon as I revert back to the classic...
Read more >
@embroider/compat | Yarn - Package Manager
This repo implements a new three-stage build system for Ember apps: The first stage achieves backward compatibility by building each classic Ember Addon...
Read more >
ember-build-prerender - npm Package Health Analysis
As such, it is only a possible replacement for prember, which uses fastboot to prerender your app. It uses the same serialization/rehydration ...
Read more >
FastBoot Shoebox
FastBoot adds two additions: dist/package.json , which contains metadata about your app for consumption by the FastBoot server. dist/assets/ ...
Read more >
Addons with incorrect or missing repository urls
Help the maintainers out: find the repo and make a PR to update package.json! Displaying 977 addons ? @ember-eui/validated-form - ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found