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 transformation error: "don't know how to turn this value into a node" #11614
Comments
Hey @samstickland! 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." |
Apologies, digging deeper into this and I think it might be an istanbul / jest issue, since removing these lines from
|
Both of them use Babel under the hood, so lets keep this open. |
Same problem here in a vue-jest stack. The error surfaces when trying to upgrade from |
Do you have a repository where I can reproduce the issue? cc @jeysal This might be related to the Babel changes in Jest 25.5.0 (jestjs/jest#9806) |
Quite possibly, yeah. Although we don't do a lot of magic there any more, so also quite possible that it's something to be fixed in istanbul. Repro would be good to see what value they try to turn into a node. Also, that error message in |
There's also a similar issue on Jest jestjs/jest#10089 |
Can you edit your console.log("coverageDataConstructor: ", coverageData.constructor) Please attach the log after rerunning The error is thrown because |
@JLHwung Hi, your change results in the following:
|
@samstickland Okay, it seems it is indeed an Object, can you add more debugging output? const Ctor = coverageData.constructor;
const funcToString = (f) => Function.prototype.toString.call(f);
console.log("instanceof", Ctor instanceof Ctor);
console.log("Ctor", funcToString(Ctor));
console.log("Object", funcToString(Object)); |
@JLHwung Sorry about the delayed reply. Adding that code gets me this:
|
Also getting this when trying to import a stencil project (compiled to es5) into a storybook webcomponents project.
If i add a console.log to the valueToNode function. I get this:
Here's the core-js.js file shipped with stencil it complains about |
@samstickland It seems to me that @jonathanazulay
I can't follow. What is your |
Hm, maybe my issue is a bit different. I'm not collecting coverage data, I'm bundling my application with storybook and get this error. But looking at the stacktrace leads me to babel My valueToNode looks like this
|
@jonathanazulay Oh the error is thrown from |
@rwaltenberg AFAIK a source map generator should not be passed as a coverage data. Can you share a reproduction repo? This can greatly help debugging issues like plugin integrations. |
@JLHwung I'm having a problem with an identical stack trace.
I have changed throw new Error(value.constructor.name); and got |
I'll try to create a public repo with the reproduction. In the meanwhile by adding try {
value = JSON.parse(value);
} catch {} just before that isPlainObject test seems to have solved the issue |
@JLHwung here it is: https://github.com/rwaltenberg/jest-coverage-error
|
@rwaltenberg Thanks for the reproduction repo! I believe it is a bug in |
This is now fixed in |
Closing this as the downstream issue is fixed. |
Bug Report
After upgrading webpack and babel I'm now faced with a few errors like this from our vue-jest based test suite, and I have no idea how to go about debugging them:
Current behavior
This is the only type of stacktrace I get, on around 8 or so tests:
Input Code
Apologies, I'm not sure what code will be useful to share here.- I'm open to suggestions. Our test suite is currently using vue-jest
Expected behavior
Files continue to be transformed correctly in the test suite
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
babel.config.js
Environment
loader
(via webpacker)The text was updated successfully, but these errors were encountered: