Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined #3208

Open
ZengXiangJun opened this issue Nov 14, 2024 · 0 comments

Comments

@ZengXiangJun
Copy link

WX20241114-124213

`
var config = {
host: 'xxx',
port: 3306,
user: 'root',
password: 'xxx',
database: 'xxxx',
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
};
var mysql = require('mysql2');
var pool = mysql.createPool(config);
var promisePool = pool.promise();

var sql = insert into memo_check_file(openid, relation_id, type, size, url, status, time) values(?, ?, ?, ?, ?, 1, now());
var params = [openid, relation_id, type, size, url];
var [rows, fields] = await promisePool.query(sql, params);
`
Calling like this will occasionally report an error like this,How to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants