'imports' of undefined
See original GitHub issueUsing Vue.js 2.2.6 with official webpack template and Vue-Quill-Editor
Console logs in dev run:
Uncaught TypeError: Cannot read property 'imports' of undefined (image-resize.min.js?c9ce:1)
Code here:
// main.js
<script>
import Vue from 'vue';
// some plugins here
import VueQuillEditor from 'vue-quill-editor';
Vue.use(VueQuillEditor);
</script>
// some *.vue file
<script>
import Quill from 'quill';
import { ImageResize } from 'quill-image-resize-module';
Quill.register('modules/imageResize', ImageResize);
export default {
name: 'editor',
data() {
return {
// some code
Editor: {
// some code
options: {
// some code
modules: {
imageResize: {
displaySize: true
}
}
}
}
}
}
}
</script>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:31
- Comments:78
Top Results From Across the Web
Cannot read property 'imports' of undefined · Issue #140 ...
I'm trying to include the image resizing but I keep getting Uncaught TypeError: Cannot read property 'imports' of undefined.
Read more >Cannot read property 'imports' of undefined (react-quill ...
Since I'm using react and thus do not have a tsconfig file, I'm unable to follow solutions available on the internet. My code:...
Read more >TypeError: Cannot read property 'imports' of undefined
I was able to compile your code and migrate. Can you share the command that you were running?
Read more >Webpack import returns undefined, depending on the order of ...
JavaScript : Webpack import returns undefined, depending on the order of imports [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
Read more >Name may be undefined, or defined from star imports
This warning occurs in conjunction with issue F403, 'from module import *' used . It means that the variable name could be undefined,...
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
Managed to get v3.0 and the image-drop module working with webpack
webpack.config.js:
Component.js:
You can also import the minified file from each module instead of transforming them with babel, but the image-drop module registers itself with Quill so you have to remove that.
@jspaine thanks a lot for assisting me!!! After 4-5 hours of pulling my hair… if found the solution:
I had to declare even Quill in the webpack…