i want to get the baseURL for metadatabase in app/layout.tsx
import { headers } from ‘next/headers’;
export const metadata = {
metadataBase: new URL(https://${headers().get('host')}
),
// other metadata fields
};
but this is not working, and here i am getting null, so let me know if you have any other solution and also tried to set the data into env file, but i do not want to do that,
and i tried to get the data from window.location.origin but that is showing undefined