Redocly / developer-portal-starter

Starter template for the Redocly developer portal
https://redoc.ly
Other
64 stars 101 forks source link

Unable to use UI components (OpenApiCodeSample) when using LandingLayout page template in .mdx file #203

Open bjonesy opened 2 years ago

bjonesy commented 2 years ago

I was building out a .mdx page and wanted to use the LandingLayout page template. When I use this template the OpenApiCodeSample will error with Incorrect definitionId:. If I remove using the template then it works just fine.

Screen Shot 2022-04-25 at 10 56 09 AM

Can I use the LandingLayout or do I need to create another template instead?

.mdx file

---
title: Demo Customization
---

import { LandingLayout, OpenApiCodeSample } from '@redocly/developer-portal/ui';

<OpenApiCodeSample
definitionId="betterCloudApi"
operationId="get_v1_tokens_lookup"
defaultLanguage="Java"
/>

export default LandingLayout;

Whether I move the export default LandingLayout; to the top or bottom of the page I get the same error. I noticed in the index.mdx file that the import is at the top https://github.com/Redocly/developer-portal-starter/blame/main/index.mdx#L27

bjonesy commented 2 years ago

Tried adding my own template as well and I get the same error

bjonesy commented 2 years ago

I also tried using FullWidthLayout layout and I get the same error