React-styleguidist: Failed to compile Module not found: Can't resolve rsg-components

Created on 19 Mar 2018  路  4Comments  路  Source: styleguidist/react-styleguidist

docker build failed, local build success

 FAIL  Failed to compile

./~/react-styleguidist/lib/rsg-components/Logo/index.js
Module not found: Can't resolve 'rsg-components/Logo/LogoRenderer' in '/www/qw/node_modules/react-styleguidist/lib/rsg-components/Logo'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] styleguidist-build: `yarn styleguidist --config=ui-kit.config.js build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] styleguidist-build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-03-17T21_26_00_692Z-debug.log

config:

module.exports = {
  require: ['babel-polyfill', p('styles/index.less')],
  title: 'titile',
  styleguideComponents: {
    LogoRenderer: p('src/styleguide/Logo'),
  },
  defaultExample: true,
  sections,
  styleguideDir: styleguideDir,
  template: p('src/index-ui-kit.html'),
  webpackConfig: {
    module: cfg.module,
    plugins: [
      new ExtractTextPlugin('styles.css'),
      new webpack.DefinePlugin({
        __APP_ELEMENT__: JSON.stringify('#app'),
        __DEV__: JSON.stringify(development),
        __DEBUG__: JSON.stringify(development),
        __LAST_BUILD_TIME__: JSON.stringify(new Date()),
        __API_ENDPOINT__: JSON.stringify(API_ENDPOINT),
        __I18N_LOCALE_FILE__: JSON.stringify(i18n_locale_file),
        'process.env.NODE_ENV': JSON.stringify(env),
      }),
    ],
  },
};

Logo.js

https://gist.github.com/AveVlad/0cd7685775cb94b711a60b168fc9b96f

node:9.4.0

"webpack": "^2.4.1",
"react-styleguidist": "6.2.7",
"babel-core": "^6.24.1",

Most helpful comment

Unfortunately this happen to me as well

All 4 comments

When something isn鈥檛 working for you, include a reproducible demo:

  1. Fork the example project: https://github.com/styleguidist/example
  2. Modify it to reproduce the issue.
  3. Push to GitHub and paste the link here.

Most likely you鈥檒l find an issue yourself, while creating a demo.

Issues without a demo will be closed!

Unfortunately this happen to me as well

and me:

 FAIL  Failed to compile

./node_modules/react-styleguidist/lib/client/rsg-components/Sections/Sections.js
Module not found: Can't resolve 'rsg-components/Sections/SectionsRenderer' in '/home/mehrad/workspace/theproject/node_modules/react-styleguidist/lib/client/rsg-components/Sections'
./node_modules/react-styleguidist/lib/client/rsg-components/ReactExample/ReactExample.js
Module not found: Can't resolve 'rsg-components/Wrapper' in '/home/mehrad/workspace/theproject/node_modules/react-styleguidist/lib/client/rsg-components/ReactExample'

for me, the issue caused by having package-lock.json and yark.lock at the same time. fixed by removing package-lock and reinstalling everything.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sapegin picture sapegin  路  3Comments

mheathcote1977 picture mheathcote1977  路  3Comments

dzimmerman902 picture dzimmerman902  路  3Comments

gargroh picture gargroh  路  3Comments

crobinson42 picture crobinson42  路  3Comments