sidorares / sidorares/node-mysql2
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
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
`
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the shown mysql2 createPool/promisePool query and capture the complete error stack and parameter values when the failure occurs. Done means reproducing the intermittent failure or isolating which query input is undefined, with a confirmed fix or clear maintainer guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100