-
Notifications
You must be signed in to change notification settings - Fork 20
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
import from './Foo' reads from Foo.scss rather than Foo.jsx #114
Comments
[removed, more up-to-date findings in next comment] |
Running some more tests, I actually narrowed it down to an issue with .scss and .jsx files specifically:
|
Can you provide a simple reproduction repo? This plugin should be outputting a Thanks! |
Yeah, sorry if I wasn't clear, took me a couple iterations to exactly identify the symptoms. This is not a conflict with the files the plugin generates, but a conflict striclty between the files present in my app, and the way 'import' imports them when meteor-css-modules is present :
As I wrote above, maybe it's not an actual bug, but a non-officially-supported (?) combination on our side (*.jsx files + imports with implicit extension), that meteor-css-modules happens to break. Anyway, here's a reproduction repo : https://github.com/yched/demo-meteor-css-modules-bug-114 |
This doesn't seem exclusive to |
(Seeing this with Meteor 1.6.0.1, did not check with 1.5)
Say I have :
The moment I add a ComponentB.(s)css file next to ComponentB.js to hold its local styles,
then the
import ComponentB from './ComponentB'
line in ComponentA.js appears to read from the css file rather than the js file.(The app crashes with the following message in the browser console :
"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of 'ComponentA'"
Adding a
console.log(ComponentB)
within ComponentA.js shows that the imported value is indeed the{ styles : { .. } }
object from the css file)For now, I'm naming all my local style files something like MyComponent_.(s)css so that the filename differ from the js component file even without the extension.
Not sure if that behavior is controlled by meteor-css-modules, or if that is something that should be fixed upstream in the Meteor bundler ?
The text was updated successfully, but these errors were encountered: