Duolith docs

Errors E0300 to E0399

E0356 Local file that is not in the app

Message specifier is not a component, so its values are not in the built app

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

The build ships a project's pages, components, behaviour files (.behaviour.duo and .behaviour.ts, decision 0152), Rust modules and public/ folder. Another local file, such as lib/util.ts, is not shipped, so a value imported from it would be missing when the page ran. Its types can be imported, since types are only checked and never run. A file outside the project's folder, such as ../../shared/t.ts, is neither checked nor shipped, so no import may reach one, not even of types: not a relative or absolute path, not import("...") in a type, not import x = require(...), and not a package whose types point outside. Packages under the project's node_modules folder are used as they are written.

How to fix it

Import only its types (import type { Name } from "./file.ts"), move the code into the script block, make it a component in components/, or, for script that makes state, a behaviour file such as behaviours/search.behaviour.ts. Move a file from outside the project into it, such as into lib/, or make the shared code a package the project depends on.

In a terminal

duolith explain E0356

Mentioned in