question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property 'Buffer' does not exist on type 'typeof globalThis'.

See original GitHub issue

Do you want to request a feature or report a bug? Bug

What is the current behavior? image

If the current behavior is a bug, please provide the steps to reproduce.

steps to reproduce issue

  1. Create a test folder
  2. Run “npm init”
  3. Run “npm i mongoose”
  4. Run “npm i typescript@latest --save-dev”
  5. Create a test.ts file and only import mongoose
  6. 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:15

github_iconTop GitHub Comments

19reactions
geordlecommented, Jul 3, 2021

Think explicitly adding @types/node should work as a temp workaround. npm i --save-dev @types/node@^14.0.0.

3reactions
SFVIIcommented, Jul 3, 2021

I just send pull request https://github.com/Automattic/mongoose/pull/10417 i think that will fix your problem

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found