久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

“未捕獲的錯(cuò)誤:接收到的數(shù)據(jù)包順序錯(cuò)誤"關(guān)

quot;Uncaught Error: Received packet in the wrong sequencequot; with devtools off - Electron + MySQL node driver + Webpack(“未捕獲的錯(cuò)誤:接收到的數(shù)據(jù)包順序錯(cuò)誤關(guān)閉 devtools - Electron + MySQL 節(jié)點(diǎn)驅(qū)動(dòng)程序 + Webpack
本文介紹了“未捕獲的錯(cuò)誤:接收到的數(shù)據(jù)包順序錯(cuò)誤"關(guān)閉 devtools - Electron + MySQL 節(jié)點(diǎn)驅(qū)動(dòng)程序 + Webpack的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

當(dāng)我使用 Electron + Webpack + node MySQL 建立一個(gè)新項(xiàng)目時(shí),我的生產(chǎn)版本是投擲:

When I set up a new project using Electron + Webpack + node MySQL my production build is throwing:

Uncaught Error: Received packet in the wrong sequence

只有當(dāng)我在我的生產(chǎn)版本中保留:config.devtools = 'eval' 時(shí),錯(cuò)誤才會(huì)消失,顯然這會(huì)導(dǎo)致更大的文件大小和一些我想避免的性能問題.

The error goes away only if I keep: config.devtools = 'eval' in my production builds, apparently this will result in a larger file size and some performance issues which I would like to avoid.

為什么我的項(xiàng)目/mysql 模塊在 devtools 設(shè)置為 '' 時(shí)崩潰??我?guī)缀跽也坏筋愃频膱?bào)告,只有我有這個(gè)問題嗎?

Why my project / mysql module crashes with devtools set to ''?? I can hardly find similar reports, am I the only one having this issue?

webpack.config.js:

webpack.config.js:

...

 if (process.env.NODE_ENV === 'production') {
      config.devtool = '' // <-------- mysql 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>

mysql/lib/protocol/Protocol.js 中第 272 行的錯(cuò)誤來(lái)源:

source of the error 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;
  }

推薦答案

這可能與 Webpack 的默認(rèn)最小化器中的 mangle 選項(xiàng)與 Node 的 Mysql 包結(jié)合使用有關(guān).

It could have something to do with the mangle option in the default minimizer of Webpack in combination with the Mysql package for node.

我遇到過相同和類似的問題,但無(wú)法真正指出它.

I've faced the same and similar issues without really being able to pin point it.

有很多與此問題相關(guān)的問題:

There are a lot of questions out there related to this issue:

  • https://github.com/webpack/webpack/issues/3150
  • https://github.com/Bajdzis/vscode-database/issues/78
  • https://github.com/mysqljs/mysql/issues/1655

但我找到的最佳解決方案是:

But the best solution I've found is this:

optimization: {
    minimizer: [new TerserPlugin({ terserOptions: { mangle: false } })] // mangle false else mysql blow ups with "PROTOCOL_INCORRECT_PACKET_SEQUENCE"
  },

在mysql問題威脅中是Rudijs:https://github.com/mysqljs/mysql/issues/1655#issuecomment-484530654

It is of Rudijs in the mysql issue threat: https://github.com/mysqljs/mysql/issues/1655#issuecomment-484530654

希望能幫到你,點(diǎn)個(gè)贊吧!

Hope this helps, give me a shout!

這篇關(guān)于“未捕獲的錯(cuò)誤:接收到的數(shù)據(jù)包順序錯(cuò)誤"關(guān)閉 devtools - Electron + MySQL 節(jié)點(diǎn)驅(qū)動(dòng)程序 + Webpack的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Typeorm Does not return all data(Typeorm 不返回所有數(shù)據(jù))
MySQL return extra records when using a long type number to filter varchar type(MySQL在使用長(zhǎng)類型數(shù)字過濾varchar類型時(shí)返回額外記錄)
MySQL Error #1071 - Specified key was too long; max key length is 767 bytes(MySQL 錯(cuò)誤 #1071 - 指定的鍵太長(zhǎng);最大密鑰長(zhǎng)度為 767 字節(jié))
MySQL command-line table column width with utf8(MySQL命令行表列寬與utf8)
Python unicode encoding issue(Python unicode 編碼問題)
Create a MySQL stored function with a dynamic number of arguments(創(chuàng)建一個(gè)帶有動(dòng)態(tài)參數(shù)數(shù)量的 MySQL 存儲(chǔ)函數(shù))
主站蜘蛛池模板: а_天堂中文最新版地址 | 三级成人在线观看 | 九九热精品在线 | 中国美女撒尿txxxxx视频 | 国产性色视频 | 99成人| 这里只有精品99re | 999久久久久久久久6666 | 网站国产| aaaaaaa片毛片免费观看 | 欧美日韩亚洲视频 | 黄色一级视频 | 欧美一二精品 | 日本三级线观看 视频 | 日韩久久中文字幕 | 久久免费视频观看 | 四虎影音 | 亚洲综合第一页 | 在线中文字幕视频 | 在线观看成人精品 | 国产精品精品久久久 | 亚洲成人蜜桃 | 不卡一区二区三区四区 | 一区二区三区国产视频 | 不卡一区二区三区四区 | 人成精品| 免费xxxx大片国产在线 | 久久久久亚洲精品 | 亚洲欧美精品在线 | 国产精品一区在线 | 久久久久免费 | 三区在线观看 | 99精品欧美一区二区三区综合在线 | 欧美综合久久久 | 精品欧美色视频网站在线观看 | 国产精品久久777777 | 欧美久久大片 | 午夜电影福利 | 波多野吉衣在线播放 | 91成人精品视频 | 日韩a v在线免费观看 |