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

"Don't know how to turn this value into a node" error from babel #33

Closed
juzerzarif opened this issue Mar 19, 2021 · 1 comment · Fixed by #34
Closed

"Don't know how to turn this value into a node" error from babel #33

juzerzarif opened this issue Mar 19, 2021 · 1 comment · Fixed by #34

Comments

@juzerzarif
Copy link

X-posted from #28:

Hate to be a party pooper but started using 1.3.1 and I'm now seeing "don't know how to turn this value into a node" from babel for one of my svelte files.

Here's the svelte file

<!-- NoResource.svelte -->
<script lang="ts">
  import Tumbleweed from './Tumbleweed.svelte';
</script>

<div class="h-full w-full flex flex-col justify-center items-center">
  <p class="snapshot-text text-4xl text-center font-semibold opacity-40 mb-6">
    Resource Does Not Exist
  </p>
  <div class="h-2/6 w-full opacity-40">
    <Tumbleweed />
  </div>
</div>

<style>
  .snapshot-text {
    font-family: 'Balsamiq Sans', cursive;
  }
</style>

Error stack trace

 /home/juzerzarif/Documents/terra-wdio-helper/src/webview-ui/common/NoResource.svelte: don't know how to turn this value into a node

      at valueToNode (node_modules/@babel/types/lib/converters/valueToNode.js:90:9)
      at Object.valueToNode (node_modules/@babel/types/lib/converters/valueToNode.js:84:58)
      at Object.exit (node_modules/istanbul-lib-instrument/dist/visitor.js:641:30)
      at PluginPass.exit (node_modules/babel-plugin-istanbul/lib/index.js:158:38)
      at newFn (node_modules/@babel/traverse/lib/visitors.js:175:21)
      at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:55:20)
      at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:42:17)
      at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:101:8)
      at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:116:16)
      at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:85:19)

This is the value that valueToNode receives as argument:

image

Will try to look more into exactly why this file fails and none of the other ones do when I get the time, any help troubleshooting is appreciated!

@sebastianrothe
Copy link
Collaborator

sebastianrothe commented Mar 24, 2021

I'm having the same problem with the current version. In the jest Repo, someone had a similar issue with Vue jestjs/jest#10089
vuejs/vue-jest#275

Got it! And made a PR.

We just need a JSON.stringify() here https://github.com/mihar-22/svelte-jester/blob/23e4892e6a9e09c93bd3f3b8a01bb25bf86baa3c/src/transformer.js#L47

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

Successfully merging a pull request may close this issue.

2 participants