docz: Error: Cannot find module 'react-docgen/dist/babylon'

Bug Report

Describe the bug

Update to docz 1.0.0-rc.3 when run docz dev,an error has occurred.

Error: Cannot find module 'react-docgen/dist/babylon'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/ronghang/work/react-components/node_modules/react-docgen-external-proptypes-handler/index.js:15:13)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/ronghang/work/react-components/node_modules/docz/node_modules/docz-core/dist/index.js:57:48)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)

A clear and concise description of what the bug is.

I check the react-docgen-external-proptypes-handler source code,i found it uses a file that does not exist in try catch.

'react-docgen/dist/babylon' does not exist in the react-docgen-external-proptypes-handler.

try {
  const buildParser = require('react-docgen/dist/babelParser').default
  babylon = buildParser()
} catch (e) {
  babylon = require('react-docgen/dist/babylon').default
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 33 (9 by maintainers)

Commits related to this issue

Most upvoted comments

this issue still exists for me @^1.2.0 so not sure why this is closed

v1.2.0 still exist

@hamed-farag I created a workaround by just commenting out babylon = require('react-docgen/dist/babylon').default in node_modules\react-docgen-external-proptypes-handler\index.js (line 15)

Has the fix been published yet? Still getting this error in 1.2.0 (which is the default version being installed)