Kustomize. Vars from file(configMapGenerator) to commonAnnotations

Cluster information:

Kubernetes version: v1.15.12-gke.2
Cloud being used: GKE
Installation method: Terraform
Host OS: N/A
CNI and version: N/A
CRI and version: N/A

I am trying to pick up variables that are in the gitlab.properties file. These should be mapped to the configmap so the vars can be picked up and passed on to the commonAnnotations. When i try to run the command kustomize build --load_restrictor none <dir> i get the following error Error: var '{GITLAB_APP ~G_~V_ConfigMap {data.GITLAB_APP}}' cannot be mapped to a field in the set of known resources

Is there a way to achieve this? The variables are in the env and i need to create 2commonAnnotations from these

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configMapGenerator:
  - name: gitlab
    envs:
      - ./../gitlab.properties

vars:
  - name: GITLAB_ENV
    objref:
      kind: ConfigMap
      name: gitlab
    fieldref:
      fieldpath: data.GITLAB_ENV
  - name: GITLAB_APP
    objref:
      kind: ConfigMap
      name: gitlab
    fieldref:
      fieldpath: data.GITLAB_APP

commonAnnotations:
  app.gitlab.com/env: $(GITLAB_ENV)
  app.gitlab.com/app: $(GITLAB_APP)


# gitlab.properties
# GITLAB_ENV=development
# GITLAB_APP=myapp

fieldPath instead of fieldpath.