How to use static site generator in ember 4?

I have already used ember-cli-staticboot and prember but there both using fastboot which is showing deprecatation error and I can’t fix it. Is there any other way other than fastboot ?

DEPRECATION: As of Ember 4.0.0, owner.inject no longer injects values into resolved instances, and calling the method has been deprecated. Since this method no longer does anything, it is fully safe to remove this injection. As an alternative to this API, you can refactor to explicitly inject _fastbootInfo on service:fastboot, or look it up directly using the getOwner API. [deprecation id: remove-owner-inject] See Ember.js - Deprecations for more details

it looks like the newest betas of fastboot have fixed this, and newest Prember version uses:

    "ember-cli-fastboot": "^3.2.0-beta.4",

So in theory if you use newest Prember version this wouldn’t be an issue?

1 Like

Maybe also interesting to you, since we ran into some limitations with fastboot/prember (mainly modifiers etc. not running), I wrote a small addon which has a similar API/usage as prember, but uses Puppeteer (headless chrome) to prerender your app instead: ember-build-prerender

Since this “just” boots the app in Chrome, all DOM functionality etc. will work just fine. And since it is build-time (there is no dev. experience!), it also doesn’t care if you build your app with embroider or with something else.

Side note, it is really cool that the actual serialization/rehydration code is all in glimmer and thus works just fine out of the box (although the usage/API is a bit wonky, but it works :sweat_smile: ) even without fastboot.

1 Like