cabinjs/bson-objectid

Cannot use namespace 'Buffer' as a type.

Closed this issue · 3 comments

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;

Please provide more insight or reproducible case.

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

@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")