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

to consolidate working react-flexbox-grid webpack configs (from different boilerplates) #26

Open
roylee0704 opened this issue Mar 12, 2016 · 11 comments

Comments

@roylee0704
Copy link
Owner

to consolidate working react-flexbox-grid webpack configs (from different boilerplates).

List of frameworks to support: (to be updated from time to time)

@roylee0704 roylee0704 self-assigned this Mar 12, 2016
@roylee0704 roylee0704 changed the title to consolidate a sets of working webpack configs (boilerplates) for react-flexbox-grid to consolidate working react-flexbox-grid webpack configs (from different boilerplates) Mar 12, 2016
@silvenon
Copy link
Collaborator

I'm working on it 😉 I wanted an excuse to learn more about webpack loaders anyway.

@silvenon
Copy link
Collaborator

There's a problem with the Babel configuration, user's babel-loader picks up the .babelrc in this repo and tries to compile src/index.js with that configuration. If the user doesn't happen to have babel-preset-es2015-loose installed, it will result in an error.

I'm not sure how to deal with this. Should this configuration strictly be in the webpack configuration, rather than a separate .babelrc? But this way we can't provide a predefined configuration. I wish there was a way to say "use babel-preset-es2015 or babel-preset-es2015-loose"…

@silvenon
Copy link
Collaborator

This only happens when you compile react-flexbox-grid with Babel, which you shouldn't do because it's already compiled. I guess that's not that serious of a problem then.

silvenon added a commit that referenced this issue Mar 13, 2016
According to recent updates, we now import flexboxgrid directly, not via SCSS files. This means that flexboxgrid is the one that users should be targeting in their loader configuration, not react-flexbox-grid.

Fixes #21.
Refs #26.
@silvenon
Copy link
Collaborator

@roylee0704 what do you mean exactly by "consolidate from different boilerplates"? Just so we're on the same page.

@hellereye
Copy link

universal-react
https://github.com/pbojinov/universal-react

clone->npm install->start

it not works fine ,error :

/home/fanfree/dev/test/universal-react/node_modules/flexboxgrid/dist/flexboxgrid.css:1
(function (exports, require, module, __filename, __dirname) { .container-fluid,
^
SyntaxError: Unexpected token .
at Object.exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:513:28)
at Module._extensions..js (module.js:550:10)
at Object.require.extensions.(anonymous function) as .js
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (/home/fanfree/dev/test/universal-react/node_modules/react-flexbox-grid/lib/components/Grid.js:13:20)

3ks for you help

@laurenskling
Copy link

I have this error too. It's because I use server side rendering of the app. Node doesn't know how to handle css.

@TheIrvingBarajas
Copy link

When ever I'm testing files that import components using flexboxgrid, I get the same error @hellereye is getting. Any advice on how to fix the problem?

@Extra-lightwill
Copy link

+1 on @hellereye error

@juanda99
Copy link

+1, @IrvingAxelB how did you solve it?

@juanda99
Copy link

juanda99 commented Apr 18, 2017

As the error in my case was with jest, this is how i solved it:

jest configuration:

    "transformIgnorePatterns": [
      "/!node_modules\/flexboxgrid/"
    ]

Then I had an error with es2015-loose so I update package files using #105

@danny-andrews
Copy link
Collaborator

Seems like an obvious solution to this problem is to run this library through webpack before publishing. Then consumers don't have to worry about setting up their build environment to deal with css-modules.

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

No branches or pull requests

8 participants