Troubleshooting
My CSS styles are broken
Check each potential cause until you find the solution:
-
Force a hard browser reload (bypassing cache). For Chrome: open developer console, right-click reload, select "Clear cache and reload".
-
Inspect the
styles.cssHTTP request in your browser's developer tools (Networking tab).- If 200 or 50x response: Check the response preview for potential PHP errors.
- If 404 response: Verify production mode (`bin/magento deploy:mode:show`) and successful static content deployment (`bin/magento setup:static-content:deploy`).
-
Check TailwindCSS compilation. If using `npm run watch`, try `npm run build` and review its output for errors.
-
If `styles.css` loads but styles are still broken, the issue is likely HTML/CSS related. Check the browser console for errors/warnings and use the DOM inspector's Styles tab for debugging.
Compilation from source: LESS file is empty: …/email-fonts.less
When running static content deploy, you might see this error:
This warning is safe to ignore; it does not abort compilation.
To resolve this, upgrade `hyva-themes/magento2-email-module` to version 1.0.4 or later.
“Incorrect CAPTCHA” error messages
Hyvä does not support legacy Magento Captcha or reCAPTCHA V1 (see Feature Matrix and Getting Started).
Disable the legacy Captcha, which is often enabled by default:
tailwindcss: Permission Denied Error
This error often occurs after macOS Sonoma/Xcode upgrades, usually due to an outdated npm installation.
Solution:
The simplest fix is to remove the `node_modules` folder and reinstall packages.
Steps:
- Navigate to your project theme directory.
- Run these commands:
This removes the old `node_modules` and reinstalls packages, ensuring compatibility.
Child theme throws exception "Overriding view file '...xml' does not match to any of the files."
This error occurs after creating and loading a child theme.
Exception #0 (LogicException): Overriding view file 'vendor/hyva-themes/magento2-reset-theme/.../layout/override/base/....xml' does not match to any of the files.
The exact XML file path may vary. If this happens, ensure the `Hyva_Theme` module is active.
If the output shows:
Then, enable the module and run `setup:upgrade`.
Missing Page Header Styling
Steps:
-
Verify TailwindCSS Purge Settings:
Ensure purge settings are correctly configured. This is a common first check. -
Check for `esi` Tags in Header:
If only the header is broken, `esi` tags might be the cause, indicating Varnish is enabled in Magento 2 admin. -
Handle Varnish in Local Development:
Disable Varnish for local development unless needed. If enabled, ensure it's correctly configured to avoid styling conflicts. -
Disable Varnish for Local Development:
- a. Go to `Stores → Configuration → Advanced → System → Full Page Cache`.
- b. Set Caching Application to Built-in Cache.
Note
For a similar issue, see Resolving Top-Menu Varnish Issues.
How to fix "Invalid form key" issue with enabled Cloudflare Rocket Loader?
Hyvä releases up to 1.2.3 are incompatible with Cloudflare Rocket Loader.
As per Cloudflare docs, add `data-cfasync="false"` to relevant JavaScript tags:
Visitors see the wrong store view and are unable to switch
Info
This is a core Magento issue, not Hyvä-specific, but included here due to its relevance.
This occurs when requests have a `store` cookie but no `X-Magento-Vary` cookie, and the default store URL's FPC record is expired. This can happen if a visitor's session times out after selecting a non-default store view.
Varnish caches pages using the `X-Magento-Vary` cookie, while Magento uses the `store` cookie for store view rendering. For the default store view (guest group), neither cookie is set. If a request has a `store` cookie for a non-default view but no `X-Magento-Vary` cookie, Varnish may incorrectly cache it as the default store view page.
Adjusting the default Varnish configuration can fix this. Replace:
sub vcl_hash {
if (req.http.cookie ~ "X-Magento-Vary=") {
hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "\1"));
}
with the following:
sub vcl_hash {
if (req.http.cookie ~ "X-Magento-Vary=") {
hash_data(regsub(req.http.cookie, "^.*?X-Magento-Vary=([^;]+);*.*$", "\1"));
} else {
# If there is no 'X-Magento-Vary' cookie set, then there should also be no 'store' cookie
# This check prevents requests with illegal cookie state from polluting the cache for default store view:
if (req.http.cookie ~ "store=") {
hash_data(regsub(req.http.cookie, "^.*?store=([^;]+);*.*$", "\1"));
}
}
(Solution courtesy of Maximilian Fickers from basecom.de)