Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

366
Views
Error in NuxtJS: Cannot Convert Undefined or Null to Object

I am getting the following error (it won't even get to the console.log part of my code):

 ERROR  error in cloudinary module Cannot convert undefined or null to object                                                                                         09:05:40  

  at Function.keys (<anonymous>)
  at setSignature (modules\cloudinary\index.js:15:14)

Here is my code:

modules/cloudinary/index.js:


export default function () {

  this.nuxt.hook('render:setupMiddleware', (app) => {
    app.use('/api/cloudinary/signature', setSignature)
  })

  function setSignature(req, res) {
    try {
      const payload = []

      Object.keys(req.body).forEach((key) => {
        payload.push(`${key}=${req.body[key]}`)
      })

      console.log(payload)

    } catch (error) {
      console.error('error in cloudinary module', error)
    }
  }
}

Something going on with the Object here. Anyone spot anything?

Updated:

Doing the following console.log gives me undefined on the req.body:

export default function () {
  // const config = this.options.privateRuntimeConfig.cloudinary

  this.nuxt.hook('render:setupMiddleware', (app) => {
    app.use('/api/cloudinary/signature', setSignature)
  })

  function setSignature(req, res) {
    try {

      console.log(req.body)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!