Flann O'Brien, 1939. A novel about an author writing a novel whose characters revolt. Joycean comedy.
From Wikipedia
At Swim-Two-Birds is a 1939 novel by Irish writer Brian O'Nolan, writing under the pseudonym Flann O'Brien. It is widely considered to be O'Brien's masterpiece, and one of the most sophisticated examples of metafiction.