Skip to content

Common issues with the development environment, what they usually mean and how to solve them

Riku Rouvila edited this page May 3, 2022 · 1 revision

TypeError: Cannot read properties of undefined (reading 'AUTH_URL')

image

Most likely caused by: Your country config package is not running

Unhandled Rejection (TypeError): Cannot read properties of undefined (reading 'svgCode')

image

Most likely caused by: config microservice isn't able to connect to MongoDB

If you're seeing 401 errors on the Network tab, log in again by navigating to http://localhost:3020.

image

After logging in, check what's the response to the following request:

image

It shouldn't be an empty object

image

If it is an empty object, open packages/config/src/handlers/applicationConfigHandler.ts and add a log statement to the following section of the code.

export default async function applicationHandler(
  request: Hapi.Request,
  h: Hapi.ResponseToolkit
) {
  try {
    // ...
  } catch (ex) {
    console.log(ex) // <- add this line
    logger.error(ex)
    return {}
  }
}

And try again. If it works straight away, the issue was most likely, that the config microservice could not connect to MongoDB (as it wasn't started on time). If it doesn't, then you should see an error.