+ Start a Discussion
Don MacDon Mac 

Using force:outputField in a lightning app

I can't get my app to work when I include a force:outputField component in it. For example, if I have the following then it's OK and I get the correct value rendered in my app:
<ui:outputText aura:id="pcode" value="{!v.product.productCode}"/>
...but if I change it to use force:outputField like so:
<force:outputField aura:id="pcode" value="{!v.product.productCode}"/>
...then I get the following failure when the app tries to render the component where I have the outputField:

"Assertion Failed!: Abstract component without provider def cannot be instantiated : markup://force:outputField : undefined. Please try again."

Is there something I am missing? This outputField component does exist in the developer reference (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_force_outputField.htm). 
Fabien TaillonFabien Taillon
Can you display more of your code ?
I have the same issue, but only when I use my app in Lightning for Visualforce, otherwise it's working.
I had an error previously where I had to add the correct attribute, see this:
http://salesforce.stackexchange.com/questions/64580/lightning-how-to-use-forceinputfield

Don't think it's the same though.
Sumit SwamiSumit Swami
Hi Fabien,

I am getting the issue when using app in Lightning for VF too.
Did you found any solution? or any workarounds how to render picklists on Lightning Components used on VFs?

Thanks,
Sumit
David Habib 12David Habib 12
Unfortuantely, it's a known issue/bug.  https://success.salesforce.com/issues_view?id=a1p300000008d7fAAA
isalewisalew
I was having a seemingly unrelated issue where a lightning component would not reload when navigating away then returning, but Salesforce support indicated it's related to the same force:inputField issue: http://salesforce.stackexchange.com/questions/119455/lightning-component-initialization-after-redirect