Giter VIP home page Giter VIP logo

Comments (24)

pedronauck avatar pedronauck commented on May 5, 2024 14

Babel 6 support now is possible by using docz-plugin-babel6 release in v0.2.6

// doczrc.js
import { babel } from 'docz-plugin-babel6'

export default {
  plugins: [babel()]
}

from docz.

pedronauck avatar pedronauck commented on May 5, 2024 7

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 babel6property on project configuration... what do you think about that?

from docz.

Swapnull avatar Swapnull commented on May 5, 2024 2

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 using babel-preset-env and babel-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?

from docz.

maxguzenski avatar maxguzenski commented on May 5, 2024 2

I don't know if babel 7 is ready for production... but docz maybe should support babel 6...

from docz.

renatorib avatar renatorib commented on May 5, 2024 1

@sos418 try puting your .mdx file into a src folder.

Docz will find for src by default, but you can change/configure it in your doczrc.js

export default {
   source: './' // it changes to root, what I think is better.
}

https://www.docz.site/documentation/project-configuration#basic-config

from docz.

Swapnull avatar Swapnull commented on May 5, 2024 1

@thomhos - I guess you are using babel-preset-react and babel-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. (babel/babel#6118)

As for the rendering undefined. Do you have the mdx file?

from docz.

fzaninotto avatar fzaninotto commented on May 5, 2024 1

My project also uses Babel 6 and I have the same error. Please make it babel6 compatible!

from docz.

ThaddeusJiang avatar ThaddeusJiang commented on May 5, 2024 1

sorry, my project can't work with babel6.

from docz.

Swapnull avatar Swapnull commented on May 5, 2024 1

@ThaddeusJiang Open a new issue with some information such as error messages, screenshots and an example repo and somebody will have a look.

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

which version of node you're using @maxguzenski?

from docz.

sos418 avatar sos418 commented on May 5, 2024

I can't also start. But my error msg is different


ERROR  Failed to compile with 1 errors                                 10:45:44

This relative module was not found:

* ../dd.mdx in ./.docz/app/imports.js

node version:8.11.2
yarn version:1.7.0

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

try to update for node v9 guys, I think that some packages aren't supporting old versions 😢

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

here using node v8.0.0 I got this message:

error @webpack-contrib/[email protected]: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0".

from docz.

sos418 avatar sos418 commented on May 5, 2024

I try to update node version to 9.11.1 and put my mdx file into a src folder.

Still have error msg:

ERROR  Failed to compile with 1 errors                                    11:46:59

This relative module was not found:

* ./ in ./src/dd.mdx

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

I just release now @sos418 trying by fixing that, just try it please 🙏

from docz.

liorbentov avatar liorbentov commented on May 5, 2024

@pedronauck, still getting the error:
image

* app/components/bzm-button/bzm-button.mdx in ./.docz/app/imports.js

from docz.

joshuaalpuerto avatar joshuaalpuerto commented on May 5, 2024

@pedronauck running docz dev is not working and throws nothing.

screen shot 2018-06-12 at 4 12 46 pm

Tried adding doczrz.js to root but still nothing.

Cheers!

from docz.

maxguzenski avatar maxguzenski commented on May 5, 2024

tested with node 10.4.0 and 9.2.0

yarn docz
yarn run v1.6.0
(node:25766) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ docz dev
ℹ  info      Removing old app files
ℹ  info      Creating new docz files
ℹ  info      Setup entries socket on port 8089


 ERROR  Failed to compile with 1 errors                                                                                     08:41:37

 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



 WAIT  Compiling...                                                                                                         08:41:37



 ERROR  Failed to compile with 1 errors                                                                                     08:41:38

 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
    at buildRootChain (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/config-chain.js:64:29)
    at loadPrivatePartialConfig (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/partial.js:55:55)
    at Object.loadPartialConfig (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/@babel/core/lib/config/partial.js:80:18)
    at Object.<anonymous> (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/babel-loader/lib/index.js:82:26)
    at Generator.next (<anonymous>)
    at step (/Users/max/Projetos/mytestapp/apps/d4_web/assets/node_modules/docz-core/node_modules/babel-loader/lib/index.js:3:221)

 @ multi ./node_modules/docz-core/node_modules/babel-polyfill/lib/index.js ./.docz/app/index.jsx

my package.json

{
  "name": "myapptest",
  "version": "1.1.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "@fortawesome/fontawesome": "^1.0.1",
    "@fortawesome/fontawesome-free-brands": "^5.0.0",
    "@fortawesome/fontawesome-pro-light": "^5.0.0",
    "@fortawesome/fontawesome-pro-regular": "^5.0.0",
    "@fortawesome/fontawesome-pro-solid": "^5.0.0",
    "@fortawesome/react-fontawesome": "^0.0.20",
    "@reach/router": "^1.0.2",
    "babel-polyfill": "^6.26.0",
    "classnames": "^2.1.3",
    "dayjs": "^1.6.4",
    "google-maps": "^3.2.1",
    "hoist-non-react-statics": "^2.1.0",
    "mobx": "^4.0.0",
    "mobx-react": "^5.0.0",
    "mobx-state-tree": "^2.0.0",
    "normalize.css": "^8.0.0",
    "phoenix": "^1.2.0",
    "prop-types": "^15.5.4",
    "raven-js": "^3.1.1",
    "react": "^16.4.0",
    "react-autosize-textarea": "^0.4.9",
    "react-content-loader": "^3.0.0",
    "react-dom": "^16.4.0",
    "react-intl": "^2.0.0-pr-3",
    "react-loadable": "^5.3.1",
    "react-overlays": "^0.8.0",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.0",
    "react-transition-group": "^2.2.0",
    "react-truncate": "^2.3.0",
    "react-waypoint": "^8.0.0",
    "styled-components": "^3.0.0",
    "uuid": "^3.0.1"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-eslint": "^8.0.0",
    "babel-loader": "^7.0.0",
    "babel-plugin-styled-components": "^1.3.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-react": "^6.3.13",
    "babel-preset-stage-0": "^6.3.13",
    "copy-webpack-plugin": "^4.0.0",
    "css-loader": "*",
    "docz": "^0.2",
    "duplicate-package-checker-webpack-plugin": "^3.0.0",
    "eslint": "^4.2.0",
    "eslint-plugin-react": "^7.3.0",
    "exports-loader": "^0.7.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "favicons-webpack-plugin": "^0.0.9",
    "file-loader": "^1.0.0",
    "imports-loader": "^0.8.0",
    "postcss": "^6.0.0",
    "postcss-browser-reporter": "^0.5.0",
    "postcss-cssnext": "^3.0.2",
    "postcss-each": "^0.10.0",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.5",
    "postcss-nested": "^3.0.0",
    "prepack-webpack-plugin": "^1.1.0",
    "react-addons-perf": "^15.0.0",
    "react-perf-devtool": "^3.0.2",
    "style-loader": "^0.21.0",
    "svgo-loader": "^2.0.0",
    "uglify-loader": "^2.0.0",
    "url-loader": "^1.0.0",
    "webcolors": "^1.2.2",
    "webpack": "^4.4.1",
    "webpack-bundle-analyzer": "^2.3.1",
    "webpack-bundle-size-analyzer": "^2.6.0",
    "webpack-cli": "^2.0.13",
    "webpack-error-notification": "^0.1.6"
  },
  "scripts": {
    "start": "webpack --config webpack.config.babel.js --watch-stdin --color --env.desktop",
    "stats": "webpack --config webpack.config.babel.js --env.desktop --json > stats.json",
    "docz": "docz dev"
  }
}

from docz.

itaditya avatar itaditya commented on May 5, 2024

@pedronauck I am having the issue mentioned in issue descrption.

 error  in ./.docz/app/index.jsx

Module build failed (from ./node_modules/happypack/loader.js):

System Details -
Node v9.3.0
Windows 7 32-bit

My project is here

from docz.

thomhos avatar thomhos commented on May 5, 2024

I was considering making a new issue, since I cannot (for the life of me) start it. I'm trying to set it up in a TS / Next.js repo.

But it starts off with an error:
"ERROR in ./.docz/app/index.jsx
Module build failed (from ./node_modules/happypack/loader.js):
Error: Cannot combine flow and typescript plugins."

If I add a doczrc.js file with typescript: true it doesn't give that error. But the client keeps saying 'page not found'. In the console it logs an error that I'm trying to render 'undefined'. I am not importing anything in my .mdx files yet, just trying to render some text.

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

Great work helping here @Swapnull... Docz is entirely built around babel 7 integrations, so if you use some babel older package, probably you will get an error. Try to update your babel packages and give some feedback for us about that!

from docz.

pedronauck avatar pedronauck commented on May 5, 2024

I think that is a good thing put this information someplace on-site or GitHub

from docz.

rnnyrk avatar rnnyrk commented on May 5, 2024

Can't seem to get it working either. Same Plugin/Preset files are not allowed to export objects, only functions. error. Using it in this way. Babel version: "babel-core": "^6.26.0", since 7 isn't stable. But if I read this correct I have to use babel 7?

screen shot 2018-06-13 at 10 59 48

from docz.

itaditya avatar itaditya commented on May 5, 2024

I have tried this using babel7 also

from docz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.