byof-demo icon indicating copy to clipboard operation
byof-demo copied to clipboard

serverless functions are not dynamic

Open dferber90 opened this issue 1 year ago • 0 comments

First of all, this is extremely educational and allowed me to understand the build output api much better.

While following along, I noticed that the demo currently seems broken:

The createServerlessFunction function compiles the HTML at build time instead of at request time:

https://github.com/lydiahallie/byof-demo/blob/e3e75acb06acb5a58ccd55b4fb55e7e162eb16e1/lib/build/bundle/serverless.ts#LL27C6-L27C6

  • For ISR this leads to the page never actually showing new content
  • For SSR this leads to the page always showing the content that was present at build time.

However the code shown in the video is actually correct and will generate the html for each request:

Video at correct time stamp: https://www.youtube.com/watch?v=j6qweJF_TIc&t=471s

image

dferber90 avatar May 26 '23 06:05 dferber90