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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues composing CSS Modules #202

Open
brosewarne opened this issue Jul 18, 2016 · 1 comment
Open

Issues composing CSS Modules #202

brosewarne opened this issue Jul 18, 2016 · 1 comment
Labels
bug V2.6.0 Webpack update V4
Milestone

Comments

@brosewarne
Copy link

brosewarne commented Jul 18, 2016

Hey guys, awesome work on the boilerplate 馃憤

However there are a few issues with using composes and CSS modules.

  1. Issue 193 is still valid.
    Repro:
  2. Node 6.2.2 + npm 3.9.5 + Windows (I only have windows to test on at the moment)
  3. clone current repo and run npm install
  4. Move the contents of the .container class from client/modules/App.css to client/modules/test.css as .test {...} and change client/modules/App.css to .container { composes: test from "./test.css" }
  5. npm run start - same error as issue 193 regarding __webpack_require__ appears
    However...
    If you start the project using the code from the repo and then make the above changes, it works after the hot module reloader has done it's thing, but it won't work if you stop and restart.

This seems like a recent issue as our project that's based off a slightly older version of Mern doesn't display this issue. However it was present when using the latest Mern repo to get this bug report together for the issues below.

  1. import vs requires for css
    After installing the new extract-text-webpack-plugin and making the change from entry to hasRuntime() in chunk-manifest-webpack-plugin, trying to run the bs command results in Module parse failed for each css import by a js file.

Changing the imports to require() fixes this error, but seems like a step back.

  1. After changing css imports to requires, running bs seems to build fine, but the built app won't start. You get errors like:
"container": "App__container__15uqt " + __webpack_require__(0).locals["test"] + ""
                                                                   ^
TypeError: Cannot read property 'test' of undefined
    at Object.<anonymous> (C:\ctm\mern-starter-master\dist\server.bundle.js:1057:72)

The production css seems to build correctly, but instead of adding the generated css classname for .test in the server bundle it's trying to look it up from a module - in this case __webpack_require__(0) is react.

This is the error I was initially going to raise, the others appeared whilst trying to replicate the issue on the lasted Mern repo. Any help or guidance that anyone can provide will be most appreciated 馃憤

@mannyhenri mannyhenri added bug V2.5.0 React V16.x labels Jun 2, 2018
@mannyhenri mannyhenri added this to To do in MERN Roadmap via automation Jun 2, 2018
@mannyhenri mannyhenri added this to the 2.5.0 milestone Jun 2, 2018
@mannyhenri
Copy link
Contributor

@rosariorussell you wan to take a look at this one?

@mannyhenri mannyhenri added V2.6.0 Webpack update V4 and removed V2.5.0 React V16.x labels Jul 12, 2018
@mannyhenri mannyhenri modified the milestones: 2.5.0, 2.6.0 Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V2.6.0 Webpack update V4
Projects
MERN Roadmap
  
To do
Development

No branches or pull requests

2 participants