Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jksmithing opened this issue Apr 14, 2022 · 0 comments

Comments

@jksmithing
Copy link

jksmithing commented Apr 14, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant