{"record":{"id":"5f6eb17b8e569d18","repo":"typst/typst","slug":"cannot-create-curve-with-infinite-size","errorCode":null,"errorMessage":"cannot create curve with infinite size","messagePattern":"cannot create curve with infinite size","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-layout/src/shapes.rs","lineNumber":120,"sourceCode":"                    Some(p) => builder.resolve_point(p, relative),\n                    None => end,\n                };\n                builder.cubic(c1, c2, end);\n            }\n\n            CurveComponent::Close(element) => {\n                builder.close(element.mode.get(styles));\n            }\n        }\n    }\n\n    let (curve, size) = builder.finish();\n    if curve.is_empty() {\n        return Ok(Frame::soft(size));\n    }\n\n    if !size.is_finite() {\n        bail!(elem.span(), \"cannot create curve with infinite size\");\n    }\n\n    // Prepare fill and stroke.\n    let fill = elem.fill.get_cloned(styles);\n    let fill_rule = elem.fill_rule.get(styles);\n    let stroke = match elem.stroke.resolve(styles) {\n        Smart::Auto if fill.is_none() => Some(FixedStroke::default()),\n        Smart::Auto => None,\n        Smart::Custom(stroke) => stroke.map(Stroke::unwrap_or_default),\n    };\n\n    let mut frame = Frame::soft(size);\n    let shape = Shape {\n        geometry: Geometry::Curve(curve),\n        stroke,\n        fill,\n        fill_rule,\n    };","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-layout/src/shapes.rs#L102-L138","documentation":"Check in layout_curve: after building the curve from its components, the computed bounding size is infinite, so the curve cannot be laid out; usually a component coordinate resolves to infinity relative to an unbounded region.","triggerScenarios":"Thrown at crates/typst-layout/src/shapes.rs:120 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use finite coordinates for all curve components","Place the curve inside a container with a definite finite size","Avoid fractional/infinite lengths in curve point and control-point coordinates"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}