Skip to content

Babel plugin fails to extract props when project Babel config contains overrides #209

Description

@jksmithing

Because we call babel.parse() without specifying the filename option (code), the plugin is not compatible with projects that have overrides in their Babel config.

E.g. if babel.config.js contains overrides: [{ test: '**/*.ts', plugins: ['@babel/plugin-transform-typescript'] }] then it will silently fail because we ignore errors and Babel cannot determine what config to use for parsing.

The issue explains the problem more thoroughly: babel/babel#11540

Passing { filename: '' } into the babel.parse() options appears to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions