Skip to content
Docs
Errors

import_dynamic

A module uses dynamic `import()`.

A module uses dynamic import().

KindBuild or validation problem
Reported byArchive and source validation
disko exit code1 (problems)

A module calls import() to load another module at run time. Only static import and export … from declarations are allowed, so the complete module graph is known when the game is published.

Why it happens

Dynamic import() is often used to load a level or mode on demand. In disko every module is packaged and loaded up front, so a static import does the same job.

Wrong

src/main.js
src/main.js

To choose between modes at run time, import all of them statically and pick one in code.

See also