embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
337 stars 136 forks source link

Fastboot error with Embroider #489

Closed puchesjr closed 1 year ago

puchesjr commented 4 years ago

Started to migrate to Embroider using Prember and Ember-cli-fastboot

ember-cli-fastboot installed with ember install ember-cli-fastboot prember installed with ember install prember

"@embroider/compat": "^0.19.0",
"@embroider/core": "^0.19.0",
"@embroider/router": "^0.19.0",
"@embroider/webpack": "^0.19.0",
"ember-cli-fastboot": "^2.2.3",
"prember": "^1.0.4",

Receiving this error during development build using ember s

@embroider/webpack (1)                   | 6626ms    
Babel: ember-cli-head (1)                | 1264ms    
@embroider/compat/app (1)                | 783ms     

App is being served by FastBoot
Error: An incompatible version between `ember-cli-fastboot` and `fastboot` was found. Please update the version of fastboot library that is compatible with ember-cli-fastboot.
    at EmberApp.readPackageJSON (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/fastboot/src/ember-app.js:405:13)
    at new EmberApp (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/fastboot/src/ember-app.js:35:23)
    at FastBoot._buildEmberApp (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/fastboot/src/index.js:52:10)
    at app.use (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/ember-cli-fastboot/index.js:335:29)
    at Layer.handle [as handle_request] (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/express/lib/router/index.js:317:13)
    at /Users/jrodkey/Projects/@now/ember-marketing/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/jrodkey/Projects/@now/ember-marketing/node_modules/express/lib/router/index.js:275:10)
ef4 commented 4 years ago

Sorry, this is a gotcha at the moment. We currently depend on a newer version of fastboot than any released version of ember-cli-fastboot uses.

If you’re using yarn you can use selective dependency resolution to get the newer fastboot directly like this: https://github.com/embroider-build/embroider/blob/a4b7bb22438539ce218665df148c7fe62874a176/package.json#L36

puchesjr commented 4 years ago

Perfect! I wasn't sure if it was something we were doing incorrectly :) you can close this issue if you'd like.

ef4 commented 4 years ago

I'll leave this issue open until there's a release so other people are more likely to find it.

abhilashlr commented 4 years ago

Sorry, this is a gotcha at the moment. We currently depend on a newer version of fastboot than any released version of ember-cli-fastboot uses.

If you’re using yarn you can use selective dependency resolution to get the newer fastboot directly like this:

https://github.com/embroider-build/embroider/blob/a4b7bb22438539ce218665df148c7fe62874a176/package.json#L36

Thanks for a temporary solution @ef4, and in case someone uses workspaces like me, you got to add this in the workspace package.json's resolutions key. I kept trying within my ember app and it never worked 😆

kiwiupover commented 4 years ago

https://github.com/GavinJoyce/embroider-spike/pull/19 @abhilashlr here is a working example of embroider and fastboot

simonihmig commented 3 years ago

FYI: there is a 3.0.0-beta.2 release meanwhile that comes with the latest fastboot dependency, and it fixed this issue here for me!

However it still doesn't work quite yet for me, now running into https://github.com/embroider-build/embroider/issues/160 it seems. Will comment over there...