Hello Victoria Lo
Thanks for writing about this topic, I've seen it around and I'll be taught next year about Automata Theory, finite states machines and the likes and I find the concepts behind it pretty interesting, I know, I know some CS stuff 😁
I hope there would be a sequel to this article, where you'll show what you've built using the finite state machine concept.
But while following the article, I noticed you didn't specify how we're to run the js file. I'll show what I did here to get the file running if you don't mind.
import {
createMachine,
interpret,
} from "./node_modules/xstate/dist/xstate.web.js";
Both createMachine & interpret I imported from ./node_modules/xstate/dist/xstate.web.js which gets created when the command npm install xstate is ran. Then I linked the js file is to a HTML file with type="module" added to the script element attribute.
I better way would be to use the CDN. Here's the Doc Page for setting up the CDN.