docz-plugin-css not working in 1.0.1 [with workaround]

Created on 15 Apr 2019  路  4Comments  路  Source: doczjs/docz

Bug report

docz-plugin-css (0.11.0) make docz (1.0.1) crash :(

image

SCSS Workaround ;)

yarn add style-loader css-loader sass-loader node-sass

Replace the docz-plugin-css call in your doczrc.js with:

export default {
  // ...
  onCreateWebpackChain: (config) => {
    // Allow SCSS imports
    config.module
      .rule('scss')
      .test(/\.css|scss|sass$/)
      .use('style')
      .loader('style-loader')
      .end()
      .use('css')
      .loader('css-loader')
      .end()
      .use('sass')
      .loader('sass-loader')
      .end();
  },
  // ...
};

CSS only Workaround ;)

yarn add style-loader css-loader

Replace the docz-plugin-css call in your doczrc.js with:

export default {
  // ...
  onCreateWebpackChain: (config) => {
    // Allow CSS imports
    config.module
      .rule('scss')
      .test(/\.css|scss|sass$/)
      .use('style')
      .loader('style-loader')
      .end()
      .use('css')
      .loader('css-loader')
      .end();
  },
  // ...
};
v1

Most helpful comment

It does not, but it depends on docz-core which does rely on react-hot-loader, and has not been updated to the latest version in docz-plugin-css

I was able to resolve this by adding the latest version of react-hot-loader as a dev dependency to my docz project. Didn't have to remove the CSS plugin

$ yarn add react-hot-loader@latest --dev

All 4 comments

@ivan-dalmet
It crashed only when you add docz-plugin-css?
I had the same problem with 'expirationTime' when updated docz to 1.0.1, exactly with hooks and react-hot-loader, and it fixed by update 'react-hot-loader' to 4.8
more: https://github.com/facebook/react/issues/14767
mby it help

Yes only docz-plugin-css. May be it use react-hot-loader.

It does not, but it depends on docz-core which does rely on react-hot-loader, and has not been updated to the latest version in docz-plugin-css

I was able to resolve this by adding the latest version of react-hot-loader as a dev dependency to my docz project. Didn't have to remove the CSS plugin

$ yarn add react-hot-loader@latest --dev

It does not, but it depends on docz-core which does rely on react-hot-loader, and has not been updated to the latest version in docz-plugin-css

I was able to resolve this by adding the latest version of react-hot-loader as a dev dependency to my docz project. Didn't have to remove the CSS plugin

$ yarn add react-hot-loader@latest --dev

Works for me here, in Ingresse's Aphrodite React.
(Under reconstruction)

Thank you, @mrmos

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mariusespejo picture mariusespejo  路  3Comments

ssylvia picture ssylvia  路  3Comments

albinekb picture albinekb  路  3Comments

hayk94 picture hayk94  路  3Comments

mquandalle picture mquandalle  路  3Comments