Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: cannot read property 'pre' of undefined #45

Closed
mengera88 opened this issue Jun 15, 2018 · 4 comments
Closed

Uncaught TypeError: cannot read property 'pre' of undefined #45

mengera88 opened this issue Jun 15, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@mengera88
Copy link

Is it related to the use of typescript?
error message:
Uncaught TypeError: Cannot read property 'pre' of undefined
at webpack_exports.default (button.mdx?a2b0:9)
at ProxyFacade (react-hot-loader.development.js?c2cb:670)
at mountIndeterminateComponent (react-dom.development.js?61bb:13272)
at beginWork (react-dom.development.js?61bb:13711)
at performUnitOfWork (react-dom.development.js?61bb:15741)
at workLoop (react-dom.development.js?61bb:15780)
at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:100)
at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:138)
at invokeGuardedCallback (react-dom.development.js?61bb:187)
at replayUnitOfWork (react-dom.development.js?61bb:15194)
webpack_exports.default @ button.mdx?a2b0:9
Component @ react-hot-loader.development.js?c2cb:670
mountIndeterminateComponent @ react-dom.development.js?61bb:13272
beginWork @ react-dom.development.js?61bb:13711
performUnitOfWork @ react-dom.development.js?61bb:15741
workLoop @ react-dom.development.js?61bb:15780
callCallback @ react-dom.development.js?61bb:100
invokeGuardedCallbackDev @ react-dom.development.js?61bb:138
invokeGuardedCallback @ react-dom.development.js?61bb:187
replayUnitOfWork @ react-dom.development.js?61bb:15194
renderRoot @ react-dom.development.js?61bb:15840
performWorkOnRoot @ react-dom.development.js?61bb:16437
performWork @ react-dom.development.js?61bb:16358
performSyncWork @ react-dom.development.js?61bb:16330
requestWork @ react-dom.development.js?61bb:16230
scheduleWork$1 @ react-dom.development.js?61bb:16096
enqueueSetState @ react-dom.development.js?61bb:11185
Component.setState @ react.development.js?72d0:273
n.safeSetState @ index.m.js?4320:1
(anonymous) @ react-hot-loader.development.js?c2cb:582
(anonymous) @ index.m.js?4320:1
Promise.then (async)
n @ index.m.js?4320:1
n @ VM6155:5
constructClassInstance @ react-dom.development.js?61bb:11333
updateClassComponent @ react-dom.development.js?61bb:13036
beginWork @ react-dom.development.js?61bb:13715
performUnitOfWork @ react-dom.development.js?61bb:15741
workLoop @ react-dom.development.js?61bb:15780
renderRoot @ react-dom.development.js?61bb:15820
performWorkOnRoot @ react-dom.development.js?61bb:16437
performWork @ react-dom.development.js?61bb:16358
performSyncWork @ react-dom.development.js?61bb:16330
interactiveUpdates$1 @ react-dom.development.js?61bb:16597
interactiveUpdates @ react-dom.development.js?61bb:2150
dispatchInteractiveEvent @ react-dom.development.js?61bb:4528
react-dom.development.js?61bb:14113 The above error occurred in the component:
in Component (created by Component)
in div (created by Styled(div))
in Styled(div) (created by Render)
in Render (created by Playground)
in Playground (created by Component)
in div (created by Component)
in Component (created by Component)
in Component (created by Component)
in Component (created by n)
in n (created by t)
in div (created by Styled(div))
in Styled(div) (created by Page)
in div (created by Styled(div))
in Styled(div) (created by Page)
in Page (created by t)
in t
in t
in DocPreview
in div (created by Styled(div))
in Styled(div) (created by Main)
in Main
in t
in ThemeConfig (created by Theme)
in Theme (created by DoczTheme)
in DefaultWrapper (created by DoczTheme)
in t (created by t)
in t (created by DoczTheme)
in DoczTheme (created by Root)
in Root (created by HotExportedRoot)
in AppContainer (created by HotExportedRoot)
in HotExportedRoot

React will try to recreate this component tree from scratch using the error boundary you provided, AppContainer.

@pedronauck pedronauck added the bug Something isn't working label Jun 17, 2018
@lorem--ipsum
Copy link

I just faced the same issue and it turns out I needed to run docz with the --typescript flag as follows (I'm using npm) :

docz dev --typescript

@good-idea
Copy link
Contributor

I was getting this error when I had a typo in my import statement at the top of my .mdx. It took a while to figure out.

Docz has been pretty great considering how little config I need to take care of. But, when things break, it's difficult to find out what I've done wrong.

@pedronauck
Copy link
Member

You're right @good-idea, unfortunately, has a lot of tricks to treat on docz, and we need asap improve error handlers 😢

@pedronauck
Copy link
Member

Fixed on v0.2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants