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 node" error when paired with Vue3 and script setup #276

Open
scaricopax8 opened this issue May 2, 2022 · 1 comment

Comments

@scaricopax8
Copy link

Description
When using babel-plugin-instanbul for a Vue 3 app that is using script setup, there is a flood of transpilation errors reading don't know how to turn this value into a node at transformFile.next for each Vue component that uses <script setup> when extending .vue files in your babel.config.js.

module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset',
  ],
  plugins: [
    ['babel-plugin-istanbul', {
      extension: ['.js', '.vue']
    }]
  ],
};

Screen Shot 2022-05-02 at 3 15 41 PM

Steps to Reproduce

  1. Create a new Vue 3 application using the vue-cli
  2. Install babel-plugin-istanbul in your dev dependencies
  3. Configure your babel.config.js as shown above
  4. Update your App.vue to use <script setup>
  5. Run npm run serve

Expected Behavior
The app is traspiled with no errors

Actual Behavior
A don't know how to turn this value into a node at transformFile.next error populates for every Vue file that uses <script setup>


If you were to revise the script in your Vue files to use export default the transpilation errors disappear.

✅ Works

<script>
import HelloWorld from './components/HelloWorld.vue'

export default {
  name: 'App',
  components: {
    HelloWorld
  }
}
</script>

❌ Fails

<script setup>
import HelloWorld from './components/HelloWorld.vue'
</script>
@yilihjy
Copy link

yilihjy commented Sep 22, 2022

I use #272 to fix this

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

2 participants