doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.55k stars 1.46k forks source link

Cannot read property 'get' of undefined #1645

Open Niofh opened 3 years ago

Niofh commented 3 years ago

npm run docz dev image

renatobenks commented 3 years ago

Hmm, that's bad! But we'll take a look at it! Thank you for reporting

Can you just share more information @Niofh? As such which version, OS, etc. Or even maybe, a repo or a codesandbox link, with the same configuration settings you're using, just to make it reproducible from our side.

azharisubroto commented 2 years ago

I'm getting the exact same problem

My Dependencies: "react": "^17.0.2", "react-dom": "^16.8.6", "react-frame-component": "^4.1.1"

OS: Windows 10 Node version: v14.16.1 NPM version: 6.14.12

songguoguo927 commented 2 years ago

I'm getting the exact same problem this is my github https://github.com/jiamxia/jiam-ui

zhaokgithub commented 2 years ago

I'm getting the exact same problem

My Dependencies: "react": "^17.0.2", "react-dom": "^17.0.2"

OS: Windows 10 Node version: v12.20.2

fcano-ut commented 2 years ago

This was a showstopper bug for me, but I managed to make Docz work nevertheless by using the gatsby theme.

There are conflicting dependencies, so installation should be as follow:

npm install --save-dev gatsby@^4.x docz@latest gatsby-theme-docz@latest @emotion/core@^10.x

Seems like the latest version of @emotion/core is causing some issues.

After that, remember to run npx gatsby develop (instead ofdocz dev), and so forth for the rest of commands

There will be some warnings in the console, ignore them:

warn Plugin gatsby-source-filesystem is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.2.0
warn Plugin gatsby-plugin-catch-links is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.0.0
warn Plugin gatsby-plugin-emotion is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.0.0
warn Plugin gatsby-source-filesystem is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.2.0
warn Plugin gatsby-plugin-catch-links is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.0.0
warn Plugin gatsby-plugin-emotion is not compatible with your gatsby version 4.5.4 - It requires
gatsby@^2.0.0

Also, I experienced that inlining Docz config in gatsby-config.js seems to be breaking something, so instead of this:

// gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: 'gatsby-theme-docz',
      options: {
        /* your custom options */
      },
    },
  ],
}

do this:

// gatsby-config.js
module.exports = {
  plugins: ['gatsby-theme-docz']
};
// doczrc.js
module.exports = {
  /* your custom options */
}