Mongoose 6.4.0: Cannot find name 'BufferConstructor'
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
6.4.0
Node.js version
18.3.0
MongoDB server version
N/A
Description
After upgrading to mongoose 6.4.0, Typescript projects fail to build due to missing BufferConstructor in typings
node_modules/.pnpm/mongoose@6.4.0/node_modules/mongoose/types/inferschematype.d.ts:145:33 - error TS2552: Cannot find name 'BufferConstructor'. Did you mean 'NumberConstructor'?
145 PathValueType extends BufferConstructor | 'buffer' | 'Buffer' | typeof Schema.Types.Buffer ? Buffer :
~~~~~~~~~~~~~~~~~
Found 1 error in node_modules/.pnpm/mongoose@6.4.0/node_modules/mongoose/types/inferschematype.d.ts:145
Steps to Reproduce
Upgrade to Mongoose 6.4.0 Compile typescript project
Expected Behavior
No error
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Getting error TS2304: Cannot find name 'Buffer' - Stack Overflow
I am trying to do base64 encode in NodeJS using TypeScript. Following code working fine in JavaScript. When I am writing same thing...
Read more >Mongoose v6.8.2: API docs
If bufferCommands is true, Mongoose will throw an error after bufferTimeoutMS if the operation is still buffered. [options.dbName] «String» The name of the ......
Read more >mongoose | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >mongoose/index.d.ts - UNPKG
152, bufferCommands?: boolean;. 153, /** The name of the database you want to use. If not provided, Mongoose uses the database name from...
Read more >Karma npm - Vulnerabilities & Security Analysis - Snyk
Find out if karma has security vulnerabilities that can threaten your software project, ... This is a result of unobstructed use of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this - cause is out of date node types
Fix:
npm install --save-dev @types/node@">=16.6.0"
(You should really replace
>=16.6.0
withyour node version
)@TomMettam no it doesn’t, Mongoose is compatible with Node versions below 16.6. This is a bug in
@types/node
. Further,@types/node
versions don’t line up with node versions beyond major versions. So@types/node@16.6.0
is a release that attempts to be compatible with Node 16.x, but doesn’t include exactly the same changes as Node 16.6.