Closed AntonSerous closed 5 years ago
In your repo you export Test both as named and default export. Could that cause problems? Does it work when you import Test as default? (import Test from './Test'
)
@draperunner
Could that cause problems?
Doesn't seem so, removing default export makes no difference, unfortunately.
Does it work when you import Test as default?
I tried, and this is the result:
If I use default export/import no warnings get shown, although
unexpected token
errors are still there. If go to the app, component page is blank, then freezes and crashes eventually.
I am now pretty sure the problem is your trailing commas (line 4 and 11) in your .babelrc
. Proper JSON does not allow them. Run it through https://jsonlint.com/ or something to validate.
@draperunner Thank you very much, great finding! I fixed .babelrc and those Unexpected token ] in JSON at position 54
errors disappeared.
Unfortunately, it doesn't fix
warning in ./src/components/Test/Test.mdx
"export 'Test' was not found in './Test'
issues 😞😞😞
Add a doczrc.js
file with typescript: true
, and you're good to go.
// doczrc.js
export default {
typescript: true
}
https://github.com/pedronauck/docz/tree/master/examples/typescript
@draperunner OMG it worked! Thank you very much, your rock!
I believe it worths mentioning this tiny config in Getting Started
guide.
Bug Report
Docz version: 1.0.4 Related issue: https://github.com/pedronauck/docz/issues/215
I'm trying to integrate docz in a project. In
mdx
file I import a component:Component's file locates in the same directory as
mdx
file and is very basic:Then I run docz
yarn docz dev
. What happens next is: 1) Right before the actual building, it throws an error 2 times:But babel config seems pretty valid to me:
"export 'Test' was not found in './Test'
warning in ./src/components/Test/Test.mdx
"export 'Test' was not found in './Test'