Here's where things get interesting. The code didn't work. It rendered a blank page So I changed the mermaid.js package version from 8.4.4 that chatGPT suggested to 8.7.0 based on example here: Rest of code remained unchanged then worked!