“Years before The Last Jedi began development, the treatment left behind by George Lucas in 2012 also had Episode VIII be the one wherein Luke Skywalker would die.”
On page 140, which comes with the heading “Luke Skywalker’s Destiny,” it is explained that George Lucas, very similar to what Rian Johnson ultimately did in 2017’s The Last Jedi, also planned to kill off the beloved Jedi in the eighth entry of the Skywalker Saga.
Luke only appears briefly at the end of The Force Awakens and, due to his death in The Last Jedi, only appeared for a short time as a Force Ghost in 2019’s The Rise of Skywalker.
Now, it has been confirmed that the original treatment from Lucas would also have killed off Luke Skywalker in Episode VIII.