react-quill: WebPack related error
Hi, @zenoamaro I got an error with webpack.
Error: ./~/react-quill/~/quill/dist/quill.js
Critical dependencies:
6:478-485 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ ./~/react-quill/~/quill/dist/quill.js 6:478-485
Related code is
require('../../../../node_modules/react-quill/node_modules/quill/dist/quill.base.css');
require('../../../../node_modules/react-quill/node_modules/quill/dist/quill.snow.css');
var styles = {
'.quill': {
'border': '1px solid #d5d5d5'
},
'.ql-toolbar': {
'box-shadow': '0 1px 10px rgba(0, 0, 0, .1)'
},
'.quill-contents ': {
'height': '250px'
}
};
<ReactQuill
styles={styles}
theme="snow"
value={data.description}
onChange={this.onTextChange}/>
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (4 by maintainers)
Are you on Windows? We had issue with regex as well and changed like so:
@tamagokun 's solution was all the fix I needed in our project! I’m amazed at how hard it was to get thist to work out of the box (well, almost) with Webpack. Thanks!
@markmiller21 here’s what I used:
Looks like you just need to escape your “.” since it is a special char in regex.
If you are requiring any of the css files from the quill dist, you’ll get more webpack errors complaining about require being undefined:
To fix this, I had to update the
noParse
regex to targetquill.js
rather than the dist folder.When using
The app will error out saying that require is not defined in /node_modules/react-quill/quill/index.js
This is because module.noParse expects to have no call to require, define or similar : module.noparse
I changed noParse to /node_modules/quill/dist/ to fix the error.
@zenoamaro are you aware of this?