Roald Dahl suffered many attacks on his books by conservative literary critics, but one of the worst and most damaging skirmishes arose over the “Oompa-Loompas” in Charlie and the Chocolate Factory.

“In the version first published, [the Oompa-Loompas were] a tribe of 3,000 amiable black pygmies who have been imported by Mr. Willy Wonka from ‘the very deepest and darkest part of the African jungle where no white man had been before.’ Mr. Wonka keeps them in the factory, where they have replaced the sacked white workers. Wonka’s little slaves are delighted with their new circumstances, and particularly with their diet of chocolate. Before they lived on green caterpillars, beetles, eucalyptus leaves, ‘and the bark of the bong-bong tree.'” [from Jeremy Treglown’s Roald Dahl: A Biography]

Dahl’s editors “saw the story as essentially Victorian in character – a ‘very English fantasy'” so they disregarded any racist misgivings about the story. Indeed, when the book first appeared in the United States in 1964 it was regarded with only acclaim and enthusiasm. It wasn’t until 1972, nearly a decade later, that a wide-ranging attack on the book was published by American writer Eleanor Cameron and the political agenda of the story finally began to be debated.

After Dahl and Cameron had many public back-and-forths in various American literary journals*, Dahl’s publishers decided that “to those growing up in a racially mixed society, the Oompa-Loompas were no longer acceptable as originally written. The following year, to accompany its new sequel, Charlie and the Great Glass Elevator, a revised edition of Charlie and the Chocolate Factory appeared, in which the Oompa-Loompas had become dwarfish hippies with long ‘golden-brown hair’ and ‘rosy-white’ skin.” [from Jeremy Treglown’s Roald Dahl: A Biography]

*The Horn Book website used to have a fantastic page about this controversy with links to many of the letters written by Dahl and Cameron, but they appear to have taken it down. You can see see it though on the Internet Archive. This Metafilter discussion also has some useful context.