Property 'Buffer' does not exist on type 'typeof globalThis'.
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
steps to reproduce issue
- Create a test folder
- Run “npm init”
- Run “npm i mongoose”
- Run “npm i typescript@latest --save-dev”
- Create a test.ts file and only import mongoose
- Run “tsc test.ts” in terminal
What is the expected behavior? Compile without any errors
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that “latest” is not a version. Node.js version - v16.4.1 Mongoose version - v5.13.1 MongoDb version - v4.4.6
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:15
Top Results From Across the Web
Property 'Buffer' does not exist on type 'typeof globalThis' on ...
d.ts:1883:33 - error TS2339: Property 'Buffer' does not exist on type 'typeof globalThis'. 1883 class Buffer extends global.Buffer ...
Read more >Mongoose error: Property 'Buffer' does not exist on type 'typeof ...
I am facing an issue that the mongoose returns an error likes node_modules/mongoose/index.d.ts:1867:33 - error TS2339: Property 'Buffer' does ...
Read more >How to fix 'Property does not exist on type Window in ...
Property does not exist on type 'Window & typeof globalThis'.ts (123). It's a pain, but really simple to fix, so let's get to...
Read more >How To Fix The "Property does not exist on type Window ...
A good example of this is the Property does not exist on type 'Window & typeof globalThis' error. The Problem. This error occurs...
Read more >Property does not exist on type Window in TypeScript
The "Property does not exist on type 'Window & typeof globalThis'" error occurs when we access a property that does not exist on...
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 Free
Top 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
Think explicitly adding
@types/node
should work as a temp workaround.npm i --save-dev @types/node@^14.0.0
.I just send pull request https://github.com/Automattic/mongoose/pull/10417 i think that will fix your problem