Responding to mark as duplciate: See below. This is not the same question as the one I am saying did not have a working answer.
This question was asked here, but the answer didn't work for either me or another person, so I figured I'd ask it again in case anyone has a solution.
I'd like to get a recordId from the URL on a standard record detail page in a community. As best I can tell from documentation, what I have should be correct:
.js file:
import { LightningElement, track, api } from 'lwc';
....
@api recordId;
.xml file:
<targets>
<target>lightningCommunity__Default</target>
<target>lightningCommunity__Page</target>
<target>lightning__RecordPage</target>
</targets>
<targetConfigs>
<targetConfig targets="lightningCommunity__Default">
<property name="recordId" type="String label="Record Id"
description="Automatically bind the page's record id to the component variable"
default="{!recordId}"/>
</targetConfig>
</targetConfigs>
Whenever recordId is referenced it throws a fatal error that the variable is undefined. Any guesses as to how to fix this?
{!recordId}