Problem to deploy in monorepo (environment variable is not used, always undefined)


I have a mono repo defined as follow :

  • apps
    • backend
    • console
    • web
  • packages
  • .gitIgnore
  • package.json
  • turbo.json
  • yarn.lock

I want to deploy backend application. I defined environment variable. But when deploying the env variable are undefined.
I add env variable in .env from cleavr and in pm2 config. But nothing works.

Please can you help me, I spend 3 week-end on this problem.

Hello @sndiaye2022,

First of all, welcome to Cleavr forum.

Please let me know in PM the name of your webapp and I’ll look into the issue.

It may be how the files are organized. If package.json and yarn.lock are only on the root folder and not also in the apps/backend folders, for instance, then the deployment won’t work.

Also, in Cleavr, there’d need to be a couple web apps created. Such as, one web app for backend where the subfolder in web app > settings > code repo is set to apps/backend and one for frontend set to apps/web.

Hello @amiedema
I have package.json and yarn.lock in apps/backend. Also in the cleavr settings, I have apps/backend as APP FOLDER.


Hello I haven`t found the option to send a PM. I followed this instruction, but not found the message button.


On the web app > settings > code repo, is the sub-directory for the FE, BE, etc identified?

For example:

Hello @amiedema

In settings for backend deploy, I have :


Hello @amiedema

My folder strature is


Hello @amiedema

In apps directory I have

And In each forder (Backend, Web, console), I have package.json and yarn.lock