Skip to content

Webpack + MySQL async/await => Error: Received packet in the wrong sequence #96

Closed
@rcbyron

Description

@rcbyron

Using Webpack minimization causes an error when running an "await query"

Error: Received packet in the wrong sequence

(This is mentioned under the npm mysql module issues: mysqljs/mysql#1655)

It has a workaround (disable mangling of function names):

optimization: {
    minimizer: [new TerserPlugin({ terserOptions: { mangle: false } })] // false otherwise mysql promises blow up with "PROTOCOL_INCORRECT_PACKET_SEQUENCE"
}

However it seems like mysql2 might support promises/async/await and mangled names?
https://www.npmjs.com/package/mysql2

Might be good to add a configuration option to use mysql2 instead, since it looks to be backwards compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions