Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,872
Community Members
 
Community Events
176
Community Groups

mongodb - TypeError: Cannot read property 'match' of undefined

I've deployed a next.js app in AWS Amplify and while it works fine on my local machine I'm getting this error when I try to access any of the /api/ route:

ERROR   Unhandled Promise Rejection     {
        "errorType": "Runtime.UnhandledPromiseRejection",
        "errorMessage": "TypeError: Cannot read property 'match' of undefined",
        "reason": {
            "errorType": "TypeError",
            "errorMessage": "Cannot read property 'match' of undefined",
            "stack": [
                "TypeError: Cannot read property 'match' of undefined",
                "    at new ConnectionString (/var/task/chunks/925.js:11169:27)",
                "    at parseOptions (/var/task/chunks/925.js:21799:17)",
                "    at new MongoClient (/var/task/chunks/925.js:26423:63)",
                "    at connectToDatabase (/var/task/chunks/817.js:30:18)",
                "    at handler (/var/task/pages/api/assets.js:191:97)",
                "    at Object.apiResolver (/var/task/chunks/925.js:36862:15)",
                "    at processTicksAndRejections (internal/process/task_queues.js:95:5)",
                "    at async Module.<anonymous> (/var/task/chunks/925.js:34836:13)"
            ]
        },
        "promise": {},
        "stack": [
            "Runtime.UnhandledPromiseRejection: TypeError: Cannot read property 'match' of undefined",
            "    at process.<anonymous> (/var/runtime/index.js:35:15)",
            "    at process.emit (events.js:400:28)",
            "    at processPromiseRejections (internal/process/promises.js:245:33)",
            "    at processTicksAndRejections (internal/process/task_queues.js:96:32)"
        ]
    }

 

I'm sure it has something to with mongodb since the error is happening in MongoClient but I'm not sure what exactly the problem is. Please help.

 

-----------------------

code from AWS project ideas.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events