Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve module 'style' when using react-flexgrid #220

Closed
kjetilge opened this issue May 29, 2016 · 5 comments
Closed

Cannot resolve module 'style' when using react-flexgrid #220

kjetilge opened this issue May 29, 2016 · 5 comments

Comments

@kjetilge
Copy link

kjetilge commented May 29, 2016

I can't get react-flexgrid to work alongside storybook.
When I add this line:
import "react-flexgrid/lib/flexgrid.css"
to my componen.jsx I get the error:

ERROR in ./client/modules/cars/components/new_car.jsx
Module not found: Error: Cannot resolve module 'style' in /Users/kjetilge/Documents/Development/Tapcar-react/mantraMui2/client/modules/cars/components
 @ ./client/modules/cars/components/new_car.jsx 39:0-42

My ./storybook/webpack.config.js looks like this:

const path = require('path');
module.exports = {
  module: {
    loaders: [
      {
        test: /\.css?$/,
        loaders: [ 'style', 'raw' ],
        include: path.resolve(__dirname, '../')
      }
    ]
  },
  resolve: {
     extensions: ['', '.js', '.jsx'],
  },
};
@track0x1
Copy link

track0x1 commented Jun 9, 2016

Did you install style-loader in your npm package?

@kjetilge
Copy link
Author

kjetilge commented Jun 9, 2016

I did, but it gave me new problems/warnings. Don't remember exactly. Switched to reflexbox now, though I think some things are missing in that package..

@track0x1
Copy link

track0x1 commented Jun 9, 2016

Also I'd remove include: ... from your loader because the css file is going to be in node_modules which isn't included by your config.

ps. a better regex might be test: /\.css$/ so you don't capture .c or .cs

@kjetilge
Copy link
Author

kjetilge commented Jun 9, 2016

This webpack stuff is totally new to me. Need to read up on the syntax etc. I'll try it !

@arunoda
Copy link
Member

arunoda commented Sep 15, 2016

Our latest storybook has much support for CSS and read our docs here: https://getstorybook.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants