EFFECT_LOAD
A lazy chunk did not download, either the engine with three.js or the module of one effect.
On this page
EFFECT_LOAD: the engine failed to loadWhy it happens
- The engine chunk did not import: the page is offline, a Content Security Policy blocks the script, or an old chunk returns 404 after a deploy. The report target is
engine, andapp.effects.statusbecomesunavailable. Instances go back to waiting withoutdata-dio-state, so the page shows its DOM. - The module of one effect did not import. The message is then the error of the import, the target is
effect:<name>, and it prints once per name. Every instance of that effect becomesfailed. - An effect module loads but has no default export that is an effect. The message then reads
module has no default effect export.
The engine gets one more attempt, on app.effects.load() or when the next effect element nears the viewport. A second failure is final until the page reloads.
How to fix
- Open the network panel and find the chunk that failed. A 404 after a deploy means the page still references chunks of the previous build: keep old chunks on the server for a while, or reload the page on this error.
- If a Content Security Policy blocks the chunk, allow the origin your chunks load from in
script-src. - For an effect module, export the effect as the default export.
import { effect } from '@dioramajs/diorama'
export default effect({ strength: 1 }, ({ surface }) => { surface.uv((uv) => uv)})An effect registered again under the same name gets a new attempt: app.effects.register() clears the failure, and its failed instances wait again.