Uncaught Error: Received packet in the wrong sequence if config.devtool = ''
See original GitHub issueHi ,
I were using for quite some time the mysql node driver in my Electron projects which works fine. But now while using Webpack, my production builds throw:
Uncaught Error: Received packet in the wrong sequence.
After some testing I have realised that the error goes away if I keep config.devtool = ‘eval’ in my webpack.conf.js file, otherwise it crashes:
if (process.env.NODE_ENV === 'production') {
config.devtool = '' // <----- this will throw Uncaught Error if I omit 'eval'
config.plugins.push(
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
)
}
home.js:
<script>
var mysql = require('mysql')
var connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'password',
database: 'EONIC'
})
connection.connect()
connection.query('SELECT * from products', function (err, rows, fields) {
if (err) throw err <---- here will the error happen
console.log(rows)
})
connection.end()
</script>
error happening in mysql/lib/protocol/Protocol.js at line 272:
if (!sequence[packetName]) {
var err = new Error('Received packet in the wrong sequence.');
err.code = 'PROTOCOL_INCORRECT_PACKET_SEQUENCE';
err.fatal = true;
this._delegateError(err);
return;
}
I understand that the error is reflected on the mysql driver’s side, but this happens only in the projects in which I use Webpack. Why does it crashes without eval??
Keeping config.devtool = ‘eval’ solves the problem but this way my project slows down and increases in size…
Webpack version: webpack: 1.13.0 webpack-dev-server: 1.14.1
Please tell us about your environment: OSX 10.11 / Windows 7
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
I haven’t looked deeply into this but fixed it in my situation by
UglifyJsPlugin
settingmangle
tofalse
. Not ideal, but works in a pinch.Hi, I’m also facing the same issue with webpack 2
@vedtam do you know any workaround ? I’m using
sequelize