docz: It doesnt start
Hi, can you help me? Docz doesn’t start…
ERROR Failed to compile with 1 errors23:29:58
error in ./.docz/app/index.jsx
Module build failed (from ./node_modules/happypack/loader.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/babel-preset-react/lib/index.js
at createDescriptor (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:138:11)
at items.map (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:69:50)
at Array.map (<anonymous>)
at createDescriptors (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:69:29)
at createPresetDescriptors (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:61:10)
at passPerPreset (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:53:96)
at cachedFunction (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/caching.js:32:19)
at presets.presets (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-descriptors.js:25:84)
at mergeChainOpts (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-chain.js:304:26)
at /Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-chain.js:267:7
@ multi ./node_modules/docz-core/node_modules/babel-polyfill/lib/index.js ./.docz/app/index.jsx
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 16
- Comments: 24 (12 by maintainers)
Babel 6 support now is possible by using docz-plugin-babel6 release in v0.2.6
Exactly @Ronnyrr, docz just works with babel 7, so you need to use it instead of babel 6 by now. I thinking of a solution for that, like a
babel6
property on project configuration… what do you think about that?I don’t know if babel 7 is ready for production… but docz maybe should support babel 6…
It looks like this is an issue with using babel6 rather than babel7.
I am getting the same
Plugin/Preset files are not allowed to export objects, only functions
as @maxguzenski when usingbabel-preset-env
andbabel-preset-react
. When I upgraded to@babel/preset-env
and@babel/preset-react
(The babel7 implementation) it worked fine.Unfortunately tools like parcelJs don’t support babel7 yet as its still in beta. I don’t want to have to do a full webpack implementation just for a documentation tool.
@pedronauck can you confirm if this will work with babel6 and provide an example config that works?
@ThaddeusJiang Open a new issue with some information such as error messages, screenshots and an example repo and somebody will have a look.
sorry, my project can’t work with babel6.
My project also uses Babel 6 and I have the same error. Please make it babel6 compatible!
@thomhos - I guess you are using
babel-preset-react
andbabel-preset-typescript
? The react preset comes with flow included, which causes this error. It has been fixed in Babel 7, but they have no plans on putting it in babel 6. (https://github.com/babel/babel/pull/6118)As for the rendering undefined. Do you have the mdx file?
@sos418 try puting your
.mdx
file into asrc
folder.Docz will find for
src
by default, but you can change/configure it in yourdoczrc.js
https://www.docz.site/documentation/project-configuration#basic-config