To run in dev mode:
yarn install
- In one terminal,
yarn vite
- In another terminal,
node app.js
- Open the app at
localhost:4000
.
To run in prod mode:
yarn install
yarn build
ENV=production node app.js
- Open the app at
localhost:4000
.
There's a bug I'm tracking across two repos:
The bug is that the $page object (a Svelte store) created by
node-inertia
does not exist in dev mode. However, surprisingly,
it exists in production. In this example app you can see this by
checking the $page object which logs to the console and lists
its keys in the navbar across the top.
We see the same issue in another app using the same frontend libraries but a Ruby backend.
Sorry the example is a little bit more than the bare minimum, it was much quicker to dust off and update the deps on this prototype I made a while ago and see that it has the same behavior than to construct a new example from scratch.