I don't know if there is a something with that too, but I'm using Typescript also.
Apr 19, 2021
6
Level 1
Webpack CLI error on reload (watch)
Hi !
Since I update from Vue2 to Vue3 and Laravel Mix v6, I got this error when I run npm run watch :
[webpack-cli] Error: The loaded module contains errors
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\dependencies\LoaderPlugin.js:110:11
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\Compilation.js:1635:8
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\util\AsyncQueue.js:347:5
at Hook.eval [as callAsync] (eval at create (C:\xampp\htdocs\shareyourproject\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncQueue._handleResult (C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\util\AsyncQueue.js:317:21)
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\util\AsyncQueue.js:300:11
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\Compilation.js:1336:15
at C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\HookWebpackError.js:69:3
at Hook.eval [as callAsync] (eval at create (C:\xampp\htdocs\shareyourproject\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at Cache.store (C:\xampp\htdocs\shareyourproject\node_modules\webpack\lib\Cache.js:107:20)
It compile well the first time but I got this error when webpack tries to reload after changes.
I have no idea from where it can come from, and I found nothing on the internet...
Level 1
Hi, I've faced same issue. Try add transpileOnly:true to the options on you webpack.mix.js, like that:
.webpackConfig({
devtool: 'source-map',
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/],
transpileOnly:true
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
}
]
},
resolve: {
extensions: ["*", ".js", ".jsx", ".vue", ".ts", ".tsx"]
}
})
That's fixed to me, after 5 days of tries and no success. Hope can help u.
4 likes
Please or to participate in this conversation.