Fetching documentation…
Severity: error | Blocks morph build: yes
A route.mx file has no default-export component for the router to mount:
error : mx-route-no-export : route src/auth/login/route.mx has no default-export component
Learn more: https://morph.levizr.com/docs/errors/mx-route-no-exportLike mx-route-unknown, this fires at build time when the route's module graph is compiled into a mountable window.
Every route.mx becomes a mount: the build generates a mount function that
instantiates the route's root component with mount-time props. With no default
export there is no root — the mount function would be empty, and navigating to
the route would show nothing. The file may still contain helpers, stores, or
channels, but the router needs its one component. Failing here (instead of a
blank window at runtime) names the exact file to fix.
// ❌ src/auth/login/route.mx — helpers only, no UI — mx-route-no-export
import { morphShared } from 'morph';
export const [attempts, setAttempts] = morphShared(0);
export function LoginForm() {
return <div>Login</div>;
}// ✅ Default export mounts at /auth/login; helpers stay as named exports
import { morphShared } from 'morph';
export const [attempts, setAttempts] = morphShared(0);
export function LoginForm() {
return <div>Login</div>;
}
export default function LoginRoute() {
return <LoginForm />;
}Steps:
export default function <Name>() { ... } rendering the route's UI.Do not disable this rule. A routeless mount cannot render.