I’ve got a new Ember app (3.26) that was running nicely with Fastboot enabled. I just added Embroider and now I am getting the following build error whenever I serve:
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.
I can see that ‘ember-cli-fastboot@2.2.3’ depends on ‘fastboot@2.0.3’. I have tried adding fastboot to my package.json, but the error is persisting.
As soon as I revert back to the classic build approach, the error disappears.
Has anyone else encountered this?
ef4
July 14, 2021, 12:25am
2
You need a version of ember-cli-fastboot that depends on fastboot >= 3.1.
I think there are only beta releases of ember-cli-fastboot that have that.
ef4
July 14, 2021, 12:26am
3
Or you can use something like yarn resolutions to force the upgrade, and that will work. That’s how embroider’s own test suite covers fastboot:
"test": "node ./test-packages/support/suite-setup-util.js --emit && jest"
},
"jest": {
"projects": [
"<rootDir>/packages/*",
"<rootDir>/test-packages/"
]
},
"resolutions": {
"**/browserslist": "^4.14.0",
"**/fastboot": "^3.1.0",
"**/qunit": "^2.14.1"
},
"devDependencies": {
"@types/jest": "^24.0.0",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"cross-env": "^7.0.3",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.0",
Perfect, thank you for your help!
Thanks @ef4 but I’ve come back to this and I am still unable to get Fastboot and Embroider to play well. I’ve gone back to basics and:
Setup a brand new, vanilla Ember 3.27 project;
Installed fastboot@3.2.0-beta.2 (following the Ember Real World example);
Served the app to ensure it’s working, which it is;
Enabled Embroider, as per the GitHub docs; and
Served the app, which no longer works.
Using http://localhost:4200/?fastboot=false
gets me into the console and I can see that the issue relates to Ember Data:
[Error] TypeError: undefined is not an object (evaluating '_ember_data_store__WEBPACK_IMPORTED_MODULE_0__.default.prototype')
Eval Code (setup.js:20)
eval
./node_modules/@ember-data/debug/setup.js (chunk.f27422fdde9dcf727521.js:160)
__webpack_require__ (chunk.b6bb8832290a7beff48c.js:31)
Eval Code (ember-data-data-adapter.js:5:114)
eval
./initializers/ember-data-data-adapter.js (chunk.07c688fc51be590ad475.js:194)
__webpack_require__ (chunk.b6bb8832290a7beff48c.js:31)
...
Is there a step I am missing with regards to making Ember Data compatible with Embroider?
ef4
July 28, 2021, 10:50pm
6
You are probably hitting Issue with @ember-data/debug/setup.js · Issue #826 · embroider-build/embroider · GitHub
You can downgrade ember-data to 3.26 or if you’re feeling adventurous, try running the not-yet-merged PR that fixes it.