enableVueLoader does not include VueLoaderPlugin? #311
Comments
Hi @thebravecowboy, You probably use I'm not sure what causes the issue you're having (we don't set that In the meantime could you try removing your version of the |
You're a lifesaver! That worked like a charm. Thank you for this project, too, it's exactly what my team needed. |
Great :) I'll leave this issue open though, so we don't forget to check if we've to change something in order to support |
I think the new |
It looks like that I think it wasn't an issue before because the old version of the loader didn't actually use webpack rules when encountering a language block (see this), so the That new version is going to be a bit harder to implement... and I'm not even sure how to allow both languages blocks without the |
Lovely:
Fun times. |
@damien-roche I meant |
Yep, finally got there :) cheers |
https://github.com/vuejs/vue-loader/tree/next vue-loader v15 has major breaking changes. // webpack.config.js
const path = require('path')
const { VueLoaderPlugin } = require('vue-loader')
module.exports = {
mode: 'development',
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
// this will apply to both plain .js files
// AND <script> blocks in vue files
{
test: /\.js$/,
loader: 'babel-loader'
},
// this will apply to both plain .css files
// AND <style> blocks in vue files
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
// this will apply to both plain .scss files
// AND <style lang="scss"> blocks in vue files
{
test: /\.scss$/,
use: [
'vue-style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
data: '$color: red;'
}
}
]
}
]
},
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
]
} |
@stupidsongshu As explained above, only adding the |
@Lyrkan Thank you. It works perfectly!. I have to logging in to give you a thumbs up. |
Please consider adding this to the docs until it's fixed ;) Right now following instructions at https://symfony.com/doc/current/frontend/encore/vuejs.html just leads to a non-working environment without pointer as to how to fix it as it loads v15 by default. |
Also btw the link to the "Advanced Options" on that page is dead. Seems impossible to install a stable dev environment right now as upstream also killed v14. |
Indeed - docs link is broken. Maybe you could open a PR? Encore with Webpack v4 is almost me, but not quite yet. |
This PR was merged into the 3.4 branch. Discussion ---------- [Encore] Fix vue-loader installation Encore isn't compatible yet with `vue-loader` 15 (symfony/webpack-encore#311). It leads to a broken install with a non-obvious error message. In the meantime, we should hint users to install v14. Commits ------- c48e4b4 [Encore] Fix vue-loader installation
@Lyrkan |
An easy peasy fix if you're using Vue-Loader v15 and above:
And that's it! |
|
Closing this issue since the |
When trying to compile code with Vue-loader, I get a bunch of the following error:
When I manually add the VueLoaderPlugin in my webpack.config.js, I get the following error:
I imagine this is a problem with my local setup, probably not a bug, but I'm not sure. I can't seem to find anything about this on the wider web.
Config file looks thus:
Install was done exactly as described on the Symfony site.
Any pointers are greatly appreciated.
The text was updated successfully, but these errors were encountered: