Book of Jubilees 41:5

And Onan knew that the seed would not be his, (but) his brother's only, and he went into the house of his brother's wife, and spilt the seed on the ground, and he was wicked in the eyes of the Lord, and He slew him.

Background and history of Book of Jubilees, and issues with this book.

R. H. Charles, The Book of Jubilees, in The Apocrypha and Pseudepigrapha of the Old Testament, vol. 2 (Oxford: Clarendon Press, 1913). Public domain in the United States (published 1913). Charles died in 1931, so the book is in the public domain in the United Kingdom. The verse text is the Joshua Williams transcription at pseudepigrapha.com. Jubilees 1:8 and 1:9 are divided at the break in the 1902 Clarendon scan (archive.org bookofjubileesor00char), where verse 9 begins “For they will forget.” That scan also numbers the angel-of-the-presence sentence as 1:29. Editorial brackets in the translation are Charles’s.