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.

Crashes when loading .tsx files

See original GitHub issue

Bug Report

Docz crashes when trying to load a “./Button.tsx” file on a standard CRA app with react-scripts-ts To Reproduce

  1. Run yarn docz:dev
  2. It runs with the following warnings
 WARNING  Compiled with 4 warnings                                                                                                  
 warning  in ./src/ui/components/Button/Button.mdx

"export 'Button' was not found in './Button'

 warning  in ./src/ui/components/Button/Button.mdx

"export 'Button' was not found in './Button'

 warning  in ./src/ui/components/Button/Button.mdx

"export 'Button' was not found in './Button'

 warning  in ./src/ui/components/Button/Button.mdx

"export 'Button' was not found in './Button'
  1. Go to localhost:3000
  2. Navigate to the component doc on the menu
  3. See the following error
Cannot read property '__docgenInfo' of undefined
Stack trace
in BasePropsTable (created by Context.Consumer)
in Component (at Button.mdx:9)
in div (created by MDXTag)
in MDXTag (created by Context.Consumer)
in Component (at Button.mdx:7)
in _default (created by o)
in o (created by AsyncComponent)
in AsyncComponent (created by t)
in t (created by Context.Consumer)
in b (created by s)
in s (created by Context.Consumer)
in Component (created by AsyncRoute)
in div (created by Styled(div))
in Styled(div) (created by ConsumerMemoization)
in div (created by Styled(div))
in Styled(div) (created by ConsumerMemoization)
in div (created by Styled(div))
in Styled(div) (created by Mt)
in Mt (created by ConsumerMemoization)
in ConsumerMemoization (created by Context.Consumer)
in CopyOnWriteConsumer (created by Context.Consumer)
in ThemeConfig (created by Wt)
in Wt (created by AsyncRoute)
in AsyncRoute (created by t)
in t (created by ConsumerMemoization)
in t (created by ConsumerMemoization)
in ConsumerMemoization (created by Context.Consumer)
in CopyOnWriteConsumer (created by Context.Consumer)
in MDXProvider (created by DocPreview)
in DocPreview (created by ConsumerMemoization)
in ThemeProvider (created by ConsumerMemoization)
in ConsumerMemoization (created by Context.Consumer)
in CopyOnWriteConsumer (created by Context.Consumer)
in ThemeConfig (created by Component)
in Component (created by DoczTheme)
in DefaultWrapper (created by DoczTheme)
in ScrollToTopBase (created by t)
in t (created by withRouter(ScrollToTopBase))
in withRouter(ScrollToTopBase) (created by DoczTheme)
in t (created by t)
in t (created by DoczTheme)
in DataServer (created by DoczTheme)
in CopyOnWriteStoreProvider (created by DoczTheme)
in ErrorBoundary (created by DoczTheme)
in DoczTheme (at root.jsx:9)
in Root (created by HotExportedRoot)
in AppContainer (created by HotExportedRoot)
in HotExportedRoot (at app/index.jsx:15)

link to repo: https://github.com/alanrsoares/frontend-primer

Environment

  • OS: Windows 10 - Ubuntu WSL
  • Node/Yarn version: node v10.12.0 / yarn 1.10.1

Additional context/Screenshots

Button.tsx

import React, { ReactNode } from "react";

export const Button = (props: { children: ReactNode }) => (
  <button>{props.children}</button>
);

Button.mdx

---
name: Button
menu: Components
---

import { Playground, PropsTable } from 'docz'
import { Button } from './Button'

# Button

<PropsTable of={Button} />

## Basic usage

<Playground>
  <Button>Click me</Button>
  <Button kind="secondary">Click me</Button>
</Playground>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nicholasesscommented, Oct 23, 2018
0reactions
matepappcommented, Jul 24, 2019

I have the same issue with the latest v2 version and the example typescript project 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio crashes when opening a TypeScript file #13407
Visual Studio crashes when opening a TypeScript file #13407 ... As far as I can tell, it happens on any .ts or .tsx...
Read more >
Jest fails to run .tsx files (CRA 2, enzyme) - Stack Overflow
I'm trying t use ts-jest to transform .tsx files but it doesn't work. I found that changing the "jsx" option in the tsconfig.json...
Read more >
VS Crashing after adding a new tsx file - Visual Studio Feedback
I added a new .tsx file to a Universal Windows Typescript project and now VS crashes after seemingly trying to do anything.
Read more >
577675 - Can't debug .tsx files when mapped to workspace
The .tsx file should be debuggable whether or not it is mapped into the workspace. (Note that .ts -- plain TypeScript -- files...
Read more >
3ds Max cannot load scenes from File menu without crashing
3ds Max will crash when opening a File menu and attempting to load a scene. Files (may) be merged or opened by drag-and-drop...
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