Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use namespace 'Buffer' as a type. #31

Closed
ppator1 opened this issue May 7, 2020 · 3 comments
Closed

Cannot use namespace 'Buffer' as a type. #31

ppator1 opened this issue May 7, 2020 · 3 comments

Comments

@ppator1
Copy link

ppator1 commented May 7, 2020

Using Vue with Typescript...

Running production build throws this error:

ERROR in C:/GIT/iAM/BridgeCareApp/VuejsApp/node_modules/bson-objectid/objectid.d.ts
21:25 Cannot use namespace 'Buffer' as a type.
19 | constructor(idString: string);
20 | constructor(array: number[]);

21 | constructor(buffer: Buffer);
| ^
22 |
23 | readonly id: string;
24 | readonly str: string;

@niftylettuce
Copy link
Collaborator

Please provide more insight or reproducible case.

@jpoles1
Copy link

jpoles1 commented Jun 20, 2020

I've also just run into this same issue, not certain how to reproduce it as of yet.

@jpoles1
Copy link

jpoles1 commented Jun 20, 2020

@ppator1, I'm not sure if our issue is resulting from the same root cause, but I was able to fix this error by changing:
import ObjectID from "bson-objectid"
to
const ObjectID = require("bson-objectid")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants