gleam-lang/gleam · error

echo with no expression outside of pipe

Error message

echo with no expression outside of pipe

What it means

Error "echo with no expression outside of pipe" thrown in gleam-lang/gleam.

Source

Thrown at compiler-core/src/javascript/expression.rs:541

            } => self.module_select(arena, module_alias, label, constructor),

            TypedExpr::NegateBool { value, .. } => {
                self.negate_with(arena, EXCLAMATION_MARK_DOCUMENT, value)
            }

            TypedExpr::NegateInt { value, .. } => {
                self.negate_with(arena, MINUS_SPACE_DOCUMENT, value)
            }

            TypedExpr::Echo {
                expression,
                message,
                location,
                ..
            } => {
                let expression = expression
                    .as_ref()
                    .expect("echo with no expression outside of pipe");
                let expresion_doc =
                    self.not_in_tail_position(None, |this| this.wrap_expression(arena, expression));
                self.echo(arena, expresion_doc, message.as_deref(), location)
            }

            TypedExpr::Invalid { .. } => {
                panic!("invalid expressions should not reach code generation")
            }
        };
        if let Position::Statement = self.scope_position
            && expression_requires_semicolon(expression)
        {
            document = document.append(arena, SEMICOLON_DOCUMENT);
        }
        if expression.handles_own_return() {
            docvec![
                arena,
                self.source_map_tracker(arena, expression.location().start),

View on GitHub (pinned to 7e623aa83d)

When it happens

Trigger: Thrown at compiler-core/src/javascript/expression.rs:541 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gleam-lang/gleam@7e623aa83d (2026-08-17). Data as JSON: /api/errors/ade0d4bc5967311a. Report an issue: GitHub.