What you describe could be one of two things: fruit flies or fungus gnats. Fruit flies would be attracted to any sort of food items or CGD, the way to prevent them is to not let anything sit too long in the enclosure.
More likely it is fungus gnats which are smaller and live in the soil and usually appear when the plant is over watered. They are almost impossible to get rid of once you have them, even if you used chemicals. The way to minimize them it to make sure any real plants in the enclosure have lots of drainage and never sit in standing water. It would be even better if you watered the plants outside the enclosure drain and them well before putting them back. It could also be from the substrate if you have standing water under it, though planting soil is more likely the culprit. Letting the plants and substrate dry a bit between misting /watering will also help.
Good luck, a little bit of practice and you will find the right amount of humidity to balance what the geckos need and what doesn't encourage bug growth.
-----
0.1 Albino Leo Gecko
0.1 Crested Gecko
1.0 Dear Boyfriend
Departed: Harvey and Spock