question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MDXTag Error: "components is not defined"

See original GitHub issue

Bug Report

Describe the bug

When visiting my local docz instance, I am met with the error components is not defined upon navigating (clicking on a sidebar link) to a specific component’s view.

I am not quite sure what causes the bug. It seems as though my mdx files are compile to be <MDXTag> components, which accepts a prop components, but the identifier provided doesn’t seem to exist in the file. 🤷‍♂️

To Reproduce

Clone, cd packages/core, npm i, npm run docz:dev. https://github.com/colshacol/g2-ops-component-library branch: “v1” Working directly from the packages/core directory.

Expected behavior

I expect docz to show me the mdx documentation I have written for the specific component.

Environment

macOS High Sierra 10.13.6
node v11.1.0 / v10.8.0
npm v6.2.0 / v6.4.1
// doczrc.js
import { css } from 'docz-plugin-css'

export default {
  src: './src/new_components',
  plugins: [
    css({
      preprocessor: 'postcss',
      cssmodules: false,
      loaderOpts: {
        plugins: [],
      },
    }),
  ],
}
"docz": "^0.12.12",
"docz-plugin-css": "^0.11.0",

(Same error with 0.12.12, 0.12.11, 0.12.10, and 0.12.9.)

Additional context/Screenshots

Screen recording: https://www.youtube.com/watch?v=XlirTYEnGmg

screen shot 2018-11-20 at 7 44 38 pm screen shot 2018-11-20 at 11 24 53 pm screen shot 2018-11-20 at 11 29 59 pm screen shot 2018-11-20 at 11 30 16 pm

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

12reactions
danielbayerleincommented, Nov 21, 2018

Same error with the latest version of docz (0.12.12)

props is not defined

Stack trace
in MDXContent (created by AsyncComponent)
in AsyncComponent (created by Component)
in Component (created by t)
in t (created by y)
in y (created by c)
in c (created by ForwardRef)
in Component (created by AsyncRoute)
in div (created by Styled(div))
in Styled(div) (created by Context.Consumer)
in div (created by Styled(div))
in Styled(div) (created by Context.Consumer)
in div (created by Styled(div))
in Styled(div) (created by St)
in St (created by Context.Consumer)
in ThemeConfig (created by Gt)
in Gt (created by AsyncRoute)
in AsyncRoute (created by t)
in t (created by Context.Consumer)
in t (created by Context.Consumer)
in MDXProvider (created by DocPreview)
in DocPreview (created by Context.Consumer)
in ThemeProvider (created by Context.Consumer)
in ThemeConfig (created by Component)
in Component (created by Component)
in ThemeProvider (at Layout.js:52)
in Layout (created by Component)
in ScrollToTopBase (created by t)
in t (created by withRouter(ScrollToTopBase))
in withRouter(ScrollToTopBase) (created by Component)
in t (created by t)
in t (created by Component)
in DataServer (created by Component)
in Provider (created by Component)
in ErrorBoundary (created by Component)
in Component (at root.jsx:8)
in Root (created by HotExportedRoot)
in AppContainer (created by HotExportedRoot)
in HotExportedRoot (at app/index.jsx:15)
6reactions
pedronauckcommented, Nov 23, 2018

Fixed on v0.12.13

Read more comments on GitHub >

github_iconTop Results From Across the Web

React JS Error: 'Component' is not defined - Stack Overflow
You missed to import Component from react in InstructorApp and ListCoursesComponent components as mentioned in the error you got also the ...
Read more >
UNPKG - @innerfuse/mdx.macro
If you use a React component which is not defined in the Javascript file and is not imported the application will stop working...
Read more >
@mdx-js/mdxast: Versions | Openbase
No longer destructures components from props in MDXTag and MDXProvider (#408) ... The following export statement used to cause a syntax error if...
Read more >
How MDX transforms into JSX - Chris Biscardi
MDXTag is a special component that handles rendering any dom-level components. ... components prop you might have used to define your own React...
Read more >
Uncaught Referenceerror: Codemirror Is Not Defined - ADocLib
docz Uncaught TypeError: Cannot read property 'close' of undefined. 12. docz MDXTag Error: components is not defined. 12. docz It doesnt start. 175....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found