{"record":{"id":"9128dbf571c89509","repo":"typst/typst","slug":"cannot-expand-into-infinite-height","errorCode":null,"errorMessage":"cannot expand into infinite height","messagePattern":"cannot expand into infinite height","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-layout/src/flow/mod.rs","lineNumber":136,"sourceCode":"#[expect(clippy::too_many_arguments)]\nfn layout_fragment_impl(\n    world: Tracked<dyn World + '_>,\n    library: &LazyHash<Library>,\n    introspector: Tracked<dyn Introspector + '_>,\n    traced: Tracked<Traced>,\n    sink: TrackedMut<Sink>,\n    route: Tracked<Route>,\n    content: &Content,\n    locator: Tracked<Locator>,\n    styles: StyleChain,\n    regions: Regions,\n    column: ColumnOptions,\n) -> SourceResult<Fragment> {\n    if !regions.size.x.is_finite() && regions.expand.x {\n        bail!(content.span(), \"cannot expand into infinite width\");\n    }\n    if !regions.size.y.is_finite() && regions.expand.y {\n        bail!(content.span(), \"cannot expand into infinite height\");\n    }\n\n    let introspector = Protected::from_raw(introspector);\n    let link = LocatorLink::new(locator);\n    let mut locator = Locator::link(&link).split();\n    let mut engine = Engine {\n        library,\n        world,\n        introspector,\n        traced,\n        sink,\n        route: Route::extend(route),\n    };\n\n    engine.route.check_layout_depth().at(content.span())?;\n\n    let mut kind = FragmentKind::Block;\n    let arenas = Arenas::default();","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/typst/typst/blob/6a6f1a97a3446fc6ba5a723b0baf20a0cfeaaef5/crates/typst-layout/src/flow/mod.rs#L118-L154","documentation":"Raised in layout_fragment_impl when the region's available height is infinite while expansion along y is requested. The content is being laid out in a vertically unbounded context (e.g. inside a block with auto height in an infinite region) but asks to expand to the full height, which would require a frame of infinite size.","triggerScenarios":"Thrown at crates/typst-layout/src/flow/mod.rs:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the enclosing container a finite height","Avoid expandable height in vertically unbounded contexts such as nested auto-height blocks","Move the content to a context with a defined height (e.g. the page body)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6a6f1a97a3446fc6ba5a723b0baf20a0cfeaaef5","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}