Troubleshooting
Hermet is designed to stop mistakes as early as possible (at compile time or build time). When something stops, first read the whole message. In many cases, it also says how to fix the problem.
| Symptom | What to check and how to fix it |
|---|---|
A page returns 500, and the log says placeholder data-island="…" has no registered Island |
Check that the placeholder is in the template of the page or the layout, and that its name is in that template's islands { … }. If you compose two documents one after the other with .map, keep the placeholder in only one of them. |
hermet check --deploy warns about worker-build |
Hermet installs worker-build itself the first time you run hermet build, hermet dev or hermet deploy (1–2 minutes, once). hermet check --deploy installs nothing, so it warns before the first build. Run hermet build first. The crates.io version that cargo install worker-build installs is not used. |
wrangler dev cannot find the configuration file |
Run hermet build in the site folder. Then add --config .hermet/wrangler/default.json to the command. If you built another mode, give the JSON file with that mode's name. |
config.env_missing appears |
Set a value for each variable that cloudflare.rs asks for with require_env. The diagnostic shows the names of the missing variables. |
deploy --no-build stops with an error about the build record |
Check that the build and the deploy use the same mode and the same configuration values. If needed, build again, and hand over the artifacts and the build record together. |
| A page returns 500 and is not cached | Look at the Worker's log. If the error is about a Server Island placeholder, match the data-island names in the HTML one to one with the names in the template's islands { … }. If the log says that an Island with the same name was registered twice, rename the placeholder in one of the two documents you composed one after the other with .map. |
| "Could not load." is shown where a component should be | In the Worker's log, look for island <name>: …. Check whether it was an error or a timeout. |
The page does not change when you change ?q= |
A page's Load does not receive the query string. Put the value in the URL path, call Api::get from a Client Island, or declare the name for a Server Island with with query(…) so that it receives the value (only the content of that Island changes). |
| You cannot check caching or purge locally | They do not work in wrangler dev. When you start the site with hermet dev, the response header x-hermet-renderer-cache (MISS or HIT) shows whether the response came from the cache, and purge works too. To check how Cloudflare's own cache behaves (rate limits, the time until a purge takes effect), deploy to a development Worker. |
A warning site.hermet_version appears |
The site builds with another version of Hermet than the hermet command you run. Use one version for both: change the tag of hermet, hermet-build and hermet-config in Cargo.toml and run cargo update -p hermet-build, or install the hermet of the site's version. hermet --version shows the one installed. It is a warning: the command still runs. |
hermet dev stops with "port 8787 … is in use" |
Another hermet dev or another program is using that port. Stop it, or choose another port number with --port. |
hermet dev stops on a migration SQL file whose content changed after it was applied |
Do not rewrite SQL that is already applied. Write the change in a new numbered file. If it is fine to recreate your local storage, start from an empty state with hermet dev --fresh. |
| Right after a deploy, buttons on a page that was already open do not work | The old JavaScript URL may return 404. Reload the page to get the new HTML and JavaScript. |
D1 fails with Type 'bigint' not supported |
Check the u64 and i64 values you pass to bind. Pass integers that fit as i32 or u32. Pass large IDs as strings. |
hermet deploy cannot choose an account |
Set the target account ID in CLOUDFLARE_ACCOUNT_ID, or set Config::account_id in the mode's configuration. |
In CI, --no-build reports that files or the build record are missing |
Check that the artifacts include what is under .hermet/. For upload-artifact in GitHub Actions, set include-hidden-files: true. |
Mistakes the build catches (some of them)
- A misspelled template field, a string in
href,onclick - A page that does not say how it is cached
- Adding the request to Load's arguments
.until_deploy()on a page that reads the database- Passing a name constant of the wrong kind (a KV constant where a D1 one belongs, and so on)
<script>in the HTML ofsrc/pages/(write JS in a component insrc/components/)- HTML outside
src/pages/andsrc/components/, and files that still have an old name (.page.htmland so on). The message shows where HTML files belong - A template whose name does not end in
.html(.htmand so on). The build collects<script>and CSS only from.htmlfiles - A
loadregistered as it is withPage::atwhen its template is not a whole HTML document innerHTMLin Client Island JS- A setting that enables the cache for the Gate
- Two bindings in the same mode that point to the same storage
Mistakes that stop the Worker when it starts
- The same route shape declared twice (
/products/{id}and/products/{slug}) - A page under
/assets/or/__hermet/ - A path that ends in
/(other than/itself), or that contains//,?or# {…}in a form or API path.prerender(…)on a page with a Server Island,only_fororredirect_with- A route at the same URL as a file in
public/(Page::at("/robots.txt", …)andpublic/robots.txt, for example)
On a site that builds the manifest on every request, every request returns 500, and the reason is in the log.
To find out more, see hermet check --format json (error codes and how to fix them), the "Local vs. production" table in the README (how local runs differ from production), and docs/verification.md (verification records and edge-case rules).