Crashes when loading .tsx files
See original GitHub issueBug Report
Docz crashes when trying to load a “./Button.tsx” file on a standard CRA app with react-scripts-ts To Reproduce
- Run
yarn docz:dev
- 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'
- Go to localhost:3000
- Navigate to the component doc on the menu
- 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:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top 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 >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
@alanrsoares You need to set typescript in doczrc.js https://github.com/pedronauck/docz/blob/master/examples/typescript/doczrc.js#L3
I have the same issue with the latest v2 version and the example typescript project 😞