GX6004: unknown island load strategy
The load attribute of an island tag has a value that is not a load strategy.
Cause
The load attribute of an island tag names the time the browser loads the island file. The value is not one of the four strategies, or it is not a static value.
| Value | The browser loads the island |
|---|---|
eager |
At once. |
idle |
When the browser is idle. |
visible |
When the element comes near the viewport. This is the default. |
media(<query>) |
When the media query matches. |
Example
package dashboard
type RevenueChartProps struct {
Title string `json:"title"`
}export default (el: HTMLElement) => {
el.textContent = "Revenue";
};package dashboard
<section>
<RevenueChart title="Revenue" load="lazy" />
</section>gx check reports:
dashboard/Page.gx:4:33: GX6004: the load attribute of <RevenueChart> has the unknown value "lazy"; use eager, idle, visible or media(<query>)Fix
- Use one of the four strategies.
- Write a media query in single quotes around the attribute value:
load='media("(min-width: 768px)")'. - Remove the attribute to load the island when it is visible.