For people who love sweets, 2018 started on a sour note: Headlines claimed that cacao, the tropical tree whose beans contain the raw ingredients for chocolate, was on the brink of extinction as a result of climate change.

As with many sensational stories, this one turned out to be inaccurate. Cacao trees aren’t going extinct. But a warmer, drier climate in the rain forests of West Africa — the world’s leading producer of cacao — may soon pose a threat to the region’s farmland.

The region’s changing climate also seems to have exacerbated a more immediate threat to the crop’s cultivation: cocoa swollen shoot virus disease, which is spread by a pencil eraser-sized insect known as the mealybug that feeds upon the sap of cacao trees.

The bug seems to thrive as temperatures rise.

Cacao tree Martin Wahlborg / Getty Images/iStockphoto

“Pests are like the canaries of the mine for climate change,” says Dr. Christian Bunn, a postdoctoral fellow with the International Center for Tropical Agriculture in Palmira, Colombia. “Their diseases are often the first symptom of climate change.”

Bunn added that there have been previous booms and busts in cacao production. “Brazil was the largest producer until pests weren’t containable anymore, then there was a similar trend in Indonesia,” he said. “The question in West Africa now is: can it be contained?”

Get the mach newsletter. This site is protected by recaptcha

Fighting back

Scientists, including a team at the University of California, Berkeley, think both threats can be mitigated — and they’ve mounted a serious effort to do just that.

With the help of a suite of genetic engineering tools including CRISPR — and money from Mars Inc., one of the world’s biggest chocolate producers — researchers with Berkeley’s Innovative Genomics Institute are working to breed a super-resilient variety of cacao tree.

The institute’s work starts with light-pink cacao flowers taken from trees grown on a plantation near Miami and then shipped to Berkeley. The tiny flowers may hold the key to making cacao trees more tolerant of weather extremes and more resistant to disease.

Cacao Innovative Genomics Institute

Scientists at the institute remove cells from the petals, sterilize them to kill off fungi or germs, and then place single plant cells into culture dishes. From there, the scientists plan to use the gene-editing tools in an attempt to create mutations within the DNA inside the cells, which would then grow into cacao trees; one or more of these many gene-edited trees may prove superior at resisting disease.

At some point, the scientists might even be able to engineer trees whose flowers bloom at different temperatures, or trees with higher yields of cacao beans.

No silver bullets

Dr. Brian Staskawicz, the institute’s science director, says it can take up to a decade to grow copies of a gene-edited crop and test them under real-world growing conditions to see if they are, in fact, more resistant to disease then ordinary plants.

And since cacao is a tree rather than a crop that’s planted annually, the road to rescuing it from the grip of nature might be even longer.

The sooner more of those flowers get tested, Staskawicz says, the sooner the scientists might be able to apply these genetic engineering techniques out on the farm — a sweet prospect for cacao farmers and chocolate lovers alike.

Bunn agrees. “I don’t believe in silver bullets,” he says. “But CRISPR must be part of the toolbox to reduce the unavoidable losses of crops to climate change.”

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.