Skip to content

Deep nesting resulting in stray undefined in output #17775

@vetruvet

Description

@vetruvet

💻

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

REPL link

Configuration file name

No response

Configuration

REPL defaults

Current and expected behavior

Current behavior: properties (and some other things like closing braces of functions) nested more than 32 levels deep is prefixed with an unexpected undefined.

Expected behavior (same as v7.28.6): no stray undefined is inserted.

Environment

  • Babel version: v7.29.0

Possible solution

No response

Additional context

One might consider 32+ levels of nesting to be excessive, but the issue originally occurred with babel processing the output of other webpack loaders (specifically vue-loader), so the input is not intentionally nested. The REPL example is the most stripped-down failure case I could reproduce.

The issue appears to be related to @babel/generator - pinning it to 7.28.6 fixed the issue as a temporary workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions