Skip to content

Doc for papr.ts results in TypeError #83

Description

@djdembeck

The default method from the documentation forpapr.ts results in the below error. I fixed it by changing this

import mongodb, { MongoClient } from 'mongodb'
...
    client = await mongodb.MongoClient.connect(uri)

To this

import { MongoClient } from 'mongodb'
...
    client = await MongoClient.connect(uri)
[Node] (node:208127) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'MongoClient' of undefined
[Node]     at connect (/home/djdembeck/projects/audnexus/dist/config/papr.js:12:46)
[Node]     at /home/djdembeck/projects/audnexus/dist/server.js:25:30
[Node]     at Server.wrap (/home/djdembeck/projects/audnexus/node_modules/fastify/lib/server.js:80:9)
[Node]     at Object.onceWrapper (events.js:421:28)
[Node]     at Server.emit (events.js:315:20)
[Node]     at emitListeningNT (net.js:1352:10)
[Node]     at processTicksAndRejections (internal/process/task_queues.js:79:21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions