-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
What problem are you facing?
The following typescript code throws an TypeError:
import Mongo from 'mongodb'; const id = new Mongo.Object();
What driver and relevant dependency versions are you using?
Driver version 4.12.0
Typescript: 4.2.4
Typescript config:
{
"compilerOptions":
,
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}
Full package.json:
{
"name": "mongotest",
"version": "2.11.0",
"description": "Mongo driver test code.",
"main": "dist/index.js",
"scripts":
,
"files": [
"dist",
"package.json",
"yarn.lock"
],
"engines":
,
"devDependencies":
,
"dependencies":
}
Steps to reproduce?
Compile the above code in typescript and then attempt to run it. Will throw the following exception:
TypeError: Cannot read properties of undefined (reading 'ObjectId')