ember-useragent icon indicating copy to clipboard operation
ember-useragent copied to clipboard

Pre-render for Fastboot and User Agent

Open hbrysiewicz opened this issue 5 years ago • 1 comments

I am using Prember with Fastboot, which does not seem to provide a user-agent when generating pages on build. This causes an error when the page it is trying to build is using the hbs helpers for user-agent.

pre-render / failed with exception: Error: Assertion Failed: No `user-agent` present in FastBoot headers.
{{#if (or (user-agent "device.isMobile") (user-agent "device.isTablet"))}}
  <MobileComponent />
{{/if}}

Is it possible to make ember-useragent not fail when no user-agent is present, but rather just return false for these helpers? Or maybe this is a Prember issue in that it should be providing some kind of user agent?

hbrysiewicz avatar Apr 21 '20 17:04 hbrysiewicz

Did you ever find a workable solution for this? It appears i'm facing the same challenge

genisd avatar Jan 12 '21 14:01 genisd