The "Cannot find module" error appears when opening a non-English language page of a headless SXA site


Description

When opening a non-English language page in the Experience Editor or clicking an item in the content tree of a headless SXA site the following errors might appear:

Cannot find module [the item's path]
System.ArgumentException
Message: Empty strings are not allowed.
Parameter name: userName
Source: Sitecore.Kernel

Solution

To resolve the issue, consider one of the following options:

Alternatively, remove the relation of the "Server Bundle" and "Server side rendering function name" fields of /sitecore/content/[your tenant]/[your site]/Settings item that contain values from the __Standard Values item.

To remove the relation:

  1. Open the item Settings of the affected module and change the values of the fields Server Bundle and Server side rendering function name, then save it.
  2. Revert the changes and save them.
  3. Publish the item.