Astronomers have found evidence for a possible planet in the M51 ("Whirlpool") galaxy, using NASA's Chandra X-ray Observatory.
https://exoplanets.nasa.gov/news/1691/first-evidence-of-a-planet-identified-beyond-our-galaxy/
Not sure about Trek novels, but I couldn’t recall any example in the Star Trek world of planets beyond our galaxy. Maybe the Great Barrier that supposedly surrounds the Milky Way, prevented extra-galactic travel? It still took too long even with warp speed?
https://exoplanets.nasa.gov/news/1691/first-evidence-of-a-planet-identified-beyond-our-galaxy/
Not sure about Trek novels, but I couldn’t recall any example in the Star Trek world of planets beyond our galaxy. Maybe the Great Barrier that supposedly surrounds the Milky Way, prevented extra-galactic travel? It still took too long even with warp speed?