isomorphic-style-loader
isomorphic-style-loader copied to clipboard
Can't resolve isomorphic-style-loader
I'm getting this error:
ERROR in ./src/components/productProperties/productProperties.es6
Module not found: Error: Can't resolve 'isomorphic_style_loader' in '/Users/byofuel/code/tonicmart'
@ ./src/components/productProperties/productProperties.es6 17:20-65
The component file in question is:
import React from 'react'
import Select from 'react-select'
import s from 'react-select/dist/react-select.css'
import withStyles from 'isomorphic-style-loader/lib/withStyles'
class ProductProperties extends React.Component {
// make this a functional component since all state is in parent?
constructor(props) {
super(props)
}
render() {
const e = React.createElement
const options = [
{ value: 'mono', label: 'Monofocal' },
{ value: 'bi', label: 'Bifocal' },
{ value: 'multi', label: 'Multifocal' }
]
const stuff = {options, name: 'optic', value: 'mono', onChange: this.props.changeEvtHandler}
const elems = [ e('input', {key: 'free', type: 'text'}),
e('Select', stuff)]
return e('div', null, elems)
}
}
// export default ProductProperties
export default withStyles(s)(ProductProperties)
Currently I've got "isomorphic-style-loader": "2.0.0",
in both dependencies and devDependencies section of package.json and I've confirmed the package was npm-installed.
Suggestions greatly welcomed...
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The error is not related to the module you posted. It seems like webpack is not able to resolve the loader file. For me when updating isomorphic-style-loader to 2.0.0 the /lib
folder was missing inside ./node_modules/isomorphic-style-loader
pointing to the prepublish hook not being run.
I'd guess, thats not an issue of this loader, but rather the package manager (I've been using yarn).
For me removing node_modules
and reinstalling everything fixed the issue.
Another option might be to point the webpack config directly to the src folder... maybe...