The book of Jasher was an older name of the book that contained both these verses.
The bible has been added to and rearranged from the beginning.
Genesis 5:1 This is the book of the generations of Adam. In the day that God created man, in the likeness of God made he him;
This marks the start of the book of the generations of Adam. This then became part of the book of Genesis, which Jesus refers to as the beginning.
I Chronicles 29:29 Now the acts of David the king, first and last, behold, they are written in the book of Samuel the seer, and in the book of Nathan the prophet, and in the book of Gad the seer,
These references are to the books of Samuel. I Samuel covers the life of Samuel. II Samuel was mostly written by Nathan and Gad, David's prophet after Samuel.
It is possible that at the time of writing of I Chronicles, there was a rearrangement of books, resulting in these references to where the writings can now be found.
At some point the book of Samuel the seer, the book of Nathan the prophet, and the book of Gad seer were separate. These then became gathered into the book of Samuel in the Hebrew bible, and split into two in the Authorised Version.
There are different changes:
- A new writer adding to an existing book.
- A writer starting a new book.
- A longer book split apart into shorter ones.
- Multiple books are gathered together into one.
- Books are rearranged.
Distinctions and subdistinctions may remain within books, as they do in the bible today.
Joshua 10:13 And the sun stood still, and the moon stayed, until the people had avenged themselves upon their enemies. Is not this written in the book of Jasher? So the sun stood still in the midst of heaven, and hasted not to go down about a whole day.
Jasher is referring to an old name for writings of Joshua, which then was added to after his death.
2 Samuel 1:18 (Also he bade them teach the children of Judah the use of the bow: behold, it is written in the book of Jasher.)
This again refers to the book it's written in, which has later been split into separate books possibly at the time I Chronicles was completed.