node-mysql2
node-mysql2 copied to clipboard
typescript error
类型“typeof import("D:/project/workbench-node-serve/node_modules/mysql2/promise")”上不存在属性“raw”
Sorry @kouxin I need more context to be able to help. Also I can only speak English and Russian
Sorry @kouxin I need more context to be able to help. Also I can only speak English and Russian
mysql.raw typeof import("D:/project/workbench-node-serve/node_modules/mysql2/index") not exiset “raw”, actually it was exiseted;
I actually had the same issue (I think). What I believe @kouxin means, is that the Typescript definition files don't define an export for mysql.raw(), so TS users can't access it (even though it's exported by the underlying JS file).
It's exported here: https://github.com/sidorares/node-mysql2/blob/6fae0c20e7459b2dee6439a2cd2beab0c45ab08d/index.js#L49
But this is missing in the definitions file: https://github.com/sidorares/node-mysql2/blob/6fae0c20e7459b2dee6439a2cd2beab0c45ab08d/typings/mysql/index.d.ts#L11-L21
@plungingChode you can update version
https://github.com/sidorares/node-mysql2/blob/ab3feb75bb4af1f6d288c0494a99aa2483ac24d5/typings/mysql/index.d.ts#L21-L23
Thanks @yuxizhe 🙋🏻♂️