Production Build is breaking Vue2-editor
See original GitHub issueFirst off this is fantastic! Thank you for your contribution!
In dev (local machine) this is working great. However when I push this into production I am getting errors. I have traced it back to the (FYI im using the default VUE webpack configuration) webpack.optimize.UglifyJsPlugin that is used to build the production code.
If I comment out:
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: true
}),
All is right with the world but there is a significant performance hit.
The following are the errors that present themselves:
TypeError: e.isBuffer is not a function
at d (vue2-editor.js:1)
at n (vue2-editor.js:1)
at t.value (vue2-editor.js:1)
at new t (vue2-editor.js:1)
at new t (vue2-editor.js:1)
at a.setQuillElement (vue2-editor.js:1)
at a.initializeVue2Editor (vue2-editor.js:1)
at a.mounted (vue2-editor.js:1)
at Dt (vue.esm.js:2921)
at Object.insert (vue.esm.js:4158)
AND
vue.esm.js:1741 TypeError: Cannot read property 'innerHTML' of null
at a.value (vue2-editor.js:1)
at wa.run (vue.esm.js:3233)
at Rt (vue.esm.js:2981)
at Array.<anonymous> (vue.esm.js:1837)
at at (vue.esm.js:1758)
It is probably worth noting that it attaches to the text area, but any default data from v-model is not persisted into the textarea.
Any help would be appreciated!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Vuejs App works in dev breaks in production -- build errors
My Vuejs app runs successfully in dev localhost but once I run the build command I get these difficult-to-debug errors.
Read more >quill-image-resize-module-fork-for-vue2-editor - npm package
ImageResize: {} } });. Functionality is broken down into modules, which can be mixed and matched as you like. For example, the default...
Read more >Vue.js Studies
Components are blocks of code, grouped together within a custom element. They make applications more manageable by breaking up the whole into reusable...
Read more >vue项目中富文本编辑器踩坑之旅 - 掘金
在官网看到了这个 issues ,题目是: Production Build is breaking Vue2-editor #104 ,日期为 2018-5-18 ,还没有解决方案,只好放弃.
Read more >A curated list of awesome things related to Vue.js
Build an e-commerce site with vue-router, vuex and vue-resource ... Deploy Vue.js — SSR(Vuetify) on Production with Pm2 and Nginx ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davidroyer sorry man, great work on this editor. I guess I was over zealous in trying to help others.
It may be worth mentioning that I am using the bubble theme and loading it in the component as such:
For the build I am posting the code from the relevant files in the /app/build directory for reference. This has the fix include that I mention above.
webpack.base.conf.js
my web pack.prod.conf.js
The problem was not in your code but it was an underlying compatibility issue between Quill.js and older versions of Uglify.JS
By upgrading to UglifyJS v3 it solved the production build issues.
This is a simple procedure simply cd into your project:
npm i -D uglifyjs-webpack-plugin
Then open:
/app/build/webpack.prod.conf.js
Add to the top:
var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
And then look for plugins UglifyJs and change to:
See my files above for reference.
Hope this helps someone. It solved my issue.
I’m using vue2-editor with the laravel framework. What worked for me was to revert to an older version of vue2-editor in my package.json (“vue2-editor”: “2.4.3”)