willviles / ember-useragent

An Ember addon for Fastboot-enabled UserAgent parsing via UAParser.js.
MIT License
37 stars 12 forks source link

Pre-render for Fastboot and User Agent #38

Open hbrysiewicz opened 4 years ago

hbrysiewicz commented 4 years ago

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?

genisd commented 3 years ago

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