Solution for Getting net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK) when running Vue project
is Given Below:
I have the following problem, my vue project used to run properly and not out of the blue it is giving me the error
net:: ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
for the chunk-vendors.js
file in my Chrome console. Only the index page is visible and I am unable to access any routes.
Here is the vue.config.js file
const webpack = require('webpack');
module.exports = {
lintOnSave: false,
configureWebpack: {
module: {
rules: [
{
test: /.html$/,
loader: 'vue-template-loader',
exclude: /index.html/,
},
],
},
optimization: {
minimizer: [new UglifyJsPlugin()],
splitChunks: {
chunks: 'all',
},
},
plugins: [
// Ignore all locale files of moment.js
new webpack.IgnorePlugin(/^./locale$/, /moment$/),
],
},
};
These are the dependencies and devDependencies that i am using in this project.
"dependencies": {
"@rxweb/reactive-forms": "^1.0.0",
"bootstrap": "^4.6.0",
"bootstrap-vue": "^2.21.2",
"core-js": "^3.16.0",
"luxon": "^1.28.0",
"moment": "^2.29.1",
"uglifyjs-webpack-plugin": "^1.2.7",
"vue": "^2.6.14",
"vue-class-component": "^7.2.3",
"vue-datetime": "^1.0.0-beta.14",
"vue-property-decorator": "^8.4.2",
"vue-router": "^3.5.2",
"vue-template-loader": "^1.0.0",
"weekstart": "^1.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-babel": "^4.5.13",
"@vue/cli-plugin-eslint": "^4.5.13",
"@vue/cli-plugin-router": "^4.5.13",
"@vue/cli-plugin-typescript": "^4.5.13",
"@vue/cli-service": "^4.5.13",
"@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"lint-staged": "^9.5.0",
"node-sass": "^5.0.0",
"sass-loader": "^10.1.0",
"typescript": "^3.9.10",
"vue-template-compiler": "^2.6.14"
},
I have tried adding proxy to the dev server as described in this post Vue npm run serve Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH but still the problem persists.
I checked the network tab and the chunk-vendor.js file was over 11.4 MB.
I am using Vue 2.6.14