Cannot import components inside a markdown file
See original GitHub issue<template>
<div class="prose prose-lg mx-auto">
<nuxt-content :document="page" />
</div>
</template>
<script>
export default {
async asyncData ({ $content, params }) {
const page = await $content(params.slug || 'index').fetch()
return {
page
}
}
}
</script>
---
title: Getting started
description: ''
---
<example></example>
Steps to reproduce
- Create a component inside the
components/
directory. - Try to include the component in a markdown file.
What is Expected?
See the component on the web page when you navigate to the URL.
What is actually happening?
Seeing an error in the console (screenshot attached.)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How do I load a markdown file into a react component?
Import App.md and use it in React component. ... Create one type definition (index.d.ts) file in one of the project directory and put...
Read more >react-markdown - npm
Start using react-markdown in your project by running `npm i ... you instead want to use JavaScript and JSX inside markdown files, use...
Read more >Getting Started | Markdown Guide
If you decide you don't like the Markdown application you're currently using, you can import your Markdown files into another Markdown application.
Read more >Imports - Astro Documentation
Astro Components ( .astro ); Markdown ( .md , .markdown , etc.) ... You can import .ts and .tsx files directly in your...
Read more >Import Markdown Files into Other Markdown Files as React ...
mdx-js enables you to import Markdown files then render them inside of other Markdown files as JSX so you can easily separate files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems there is an issue with local components registration in development due to live edit mode.
For now, to solve the issue you can put your components inside
components/global/
using Nuxt 2.13+ and settingcomponents: true
in yournuxt.config.js
, see Vue components >Global components
.You will also be able to disable the live edit feature once #285 is merged.
is this resolved ? in nuxt theme docs it can be override by adding