Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

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

Open
bjonesy opened this issue Apr 25, 2022 · 2 comments

Comments

@bjonesy
Copy link

bjonesy commented Apr 25, 2022

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
Copy link
Author

bjonesy commented Apr 25, 2022

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

@bjonesy
Copy link
Author

bjonesy commented Apr 25, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant