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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: generating source maps fails due to sourcesContent
being undefined
#15444
Comments
Hey @christian-bromann! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
Thanks for the detailed report, this should be fixed by #15445. The reason for the problem is that we didn't handle the absence of |
Thank you @liuxingbaoyu |
Awesome, good to know it is being addressed, good job team. |
Fixed in |
Thanks for the quick turnaround folks 馃憦 |
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
I am trying to transform code via:
where
code
is:and
babelOpts
is:Configuration file name
No response
Configuration
n/a
Current and expected behavior
It currently fails with latest release on:
because when creating the trace map at
the returned object has
sourcesContent: undefined,
.Environment
@babel/generator: 7.21.0
Node.js v18.7.0
NPM v8.15.0
macOS
Possible solution
No response
Additional context
This happened during recent Babel updates. It is hard for me to say what is the root cause of this. I am working on WebdriverIO and we use Babel as part of
vite-plugin-istanbul
to generate code coverage reports.You can reproduce this by checking out https://github.com/webdriverio/component-testing-examples/tree/main/create-react-app and run any of the example directories.
I am aware that this is not necessary an issue of Babel but would love to understand what the root cause of this is and am happy to work on a fix if someone can give me any pointers.
The text was updated successfully, but these errors were encountered: