Astro inside Container Machine Support

Found a bug or a number that looks wrong? Email us and include your device, iOS version and the inputs you used.

Email Support

Common Questions

How do I open the dev server in Safari?

Start the dev server with the `--host 0.0.0.0` option so it listens outside the machine. Then find the machine's IP address in the output of `container machine inspect astro` and go to that address on port 4321.

I saved a file, but the page didn't reload. What's wrong?

File-change events from the Mac don't always reach the machine through the shared folder. Turn on polling in `astro.config.mjs` by adding `vite: { server: { watch: { usePolling: true, interval: 300 } } }` to your config.

Why did npm say it couldn't find package.json?

Commands run in whatever folder your Mac shell is in, and quoted `sh -c` commands get split on spaces, so a `cd` inside them never takes effect. Change to the project folder on your Mac first, then run the command. Folder names with spaces can cause the same problem.

Can I reuse the node_modules folder I made on my Mac?

No. Packages like Astro's build tools install binaries for the system they were installed on. Delete `node_modules` and `package-lock.json`, then run `npm install` inside the machine.

Astro can't read an image I just added. Why?

Some Mac apps, including screenshot tools, save files that only your Mac user can read. Run `chmod a+r` on the file so the machine's user can read it too.

How do I stop the dev server?

Run `npx astro dev stop` inside the machine, or `pkill -f "astro dev"` if it doesn't respond. To stop everything at once, run `container machine stop astro`. The next `container machine run` starts it again.