Closed ghost closed 6 years ago
Forgot to define jquery in webpack config...
plugins: [
new webpack.ProvidePlugin({
Vue: ['vue/dist/vue.esm.js', 'default'],
jQuery: 'jquery',
$: 'jquery',
'window.jQuery': 'jquery',
}),
],
Got the exact same problem. Not using webpack.
window.$ = window.jQuery = jQuery = $ = require('jquery');
Been included in main.js
<script src="https://cdn.jsdelivr.net/npm/trumbowyg@2"></script>
Has been added.
Still got the error.
I am getting the same error - using Webpack, but also using the ProvidePlugin to expose global jQuery/Vue.
same error - using Webpack.
If someone can share a minimal reproduction repo on github, I am happy to troubleshoot.
@gaeld @ims-one @samdjstevens Did you guys get any solution?
If someone can share a minimal reproduction repo on github, I am happy to troubleshoot.
@preeteshjain
I tried my best, tried expose-loader
too. But no luck.
The error is coming from trumbowyg
itself.
You are right, it seems like Trumbowyg isn't playing well with vue-cli apps at all.
Guess we will have to wait till v3 release which will drop the jQuery dependency.
so how do I load this now? This plugin doesnt work out of the box. I am simply using the Vue plugin but it throws the above error.
@bert-w I have been using this package with webpack without any issue. I have also published a running example here https://ankurk91.github.io/vue-trumbowyg/
You can check my webpack-config file in this repo.
@bert-w I have been using this package with webpack without any issue. I have also published a running example here https://ankurk91.github.io/vue-trumbowyg/
You can check my webpack-config file in this repo.
You said earlier that "The error is coming from trumbowyg itself." But your example ar https://ankurk91.github.io/vue-trumbowyg is running well.
I tried downgrading the versions of the trumbowyg and vue trumbowyg both. Still getting the same error -
Error in mounted hook: "TypeError: this.el.trumbowyg is not a function"
But your example ar https://ankurk91.github.io/vue-trumbowyg is running well.
It means that this component does not have any issue at all, check you webpack configs.😉
I was able to run this component in a fresh vue-cli project. I have added a wiki for the same.
https://github.com/ankurk91/vue-trumbowyg/blob/master/wiki/vue-cli.md
someone with solution for this one??
I'm submitting a ... (check one with "x")
Tell about your platform "jquery": "^3.3.1", "vue-trumbowyg": "^3.4.0", "vue": "^2.5.2",
Current behavior I installed jquery and trumbowyg via npm, imported jquery in my index.html file and the trumbowyg component along with the css in my component where I'd like to render the text editor. When I refreshed the page I had an error in my console stating:
[Vue warn]: Error in mounted hook: "TypeError: this.el.trumbowyg is not a function"
found in
---> at component.vue