16-08-22
I’ve experienced some very strange issues lately
I switched this site over to the Server Side Rendering offered by Netlify & Astro recently and it was all okay, nothing really changed yet as I hadn’t implemented the functionality I wanted SSR for yet.
Then somewhere along the lines things broke. My homepage posts were all there with their data, however the links weren’t working. 🤔
I had a look around and found the ‘post.frontmatter.url’ I was using is now undefined. I went through everything and then finally discovered the Astro docs were out of date for the very, very (couple days) new version that I accidentally updated too. They had changed this to ‘post.url’ now which was confirmed in the Astro Discord. Two hours after inital error everything’s working again!
The Edge ✨
I tried to deploy to Netlify’s edge server and that went about how you would’ve expected with an edge runtime even though “in theory” everything should be supported. There seems to a bit of code someone recently pushed to Astro’s codebase using “Buffer” which of course is not in the Deno runtime API. However this appears to already have a pull request waiting to be merged in! The astro discord is fantastic to stay up to date on these things and they are all super helpful.
Spotify’s API
My other frustrating issue I found is with . Their “get current playing track” endpoint on their API is great and it’s awesome I could add it to this site. But why do they return nothing when nothing is playing rather than the {“is_playing”: “false”} in the same way they do when something is playing? This lead to a kind of amazing bug where the entire site would stop working when I stopped listening to Spotify.
As annoying as these bugs have been, all the APIs and platforms have been super fun to play around with and experiment.
Now you can see what I’m listening too, just down there! ⤵️ Also idea comes from @leeerob - thank you to him and his helpful blog post on using the Spotify API for this purpose.