OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Simple vue component returns "Uncaught SyntaxError: import not found: default"

  • Thread starter Thread starter movac
  • Start date Start date
M

movac

Guest
Not sure what I'm doing wrong here, I'm breaking some large components down into smaller components, and I've just created a component that is mostly empty like so:

Code:
<div>
  test
</div>

<script>
  export default {
    data() {}
  }
</script>

I call it in the parent component using <my-new-component /> (which works with all other components.)

And in the parent component's script tag I have

Code:
import MyNewComponent from "path"; // everything directs correctly when I click on the component name and path in my IDE

export default {
  components: {
    MyNewComponent
  }
}

I can't get rid of the Uncaught SyntaxError: import not found: default within the MyNewComponent.vue file

This is how I'm using all my other components, what am I forgetting here? I'm on Vue 2.7

<p>Not sure what I'm doing wrong here, I'm breaking some large components down into smaller components, and I've just created a component that is mostly empty like so:</p>
<pre><code><div>
test
</div>

<script>
export default {
data() {}
}
</script>
</code></pre>
<p>I call it in the parent component using <code><my-new-component /></code> (which works with all other components.)</p>
<p>And in the parent component's script tag I have</p>
<pre><code>import MyNewComponent from "path"; // everything directs correctly when I click on the component name and path in my IDE

export default {
components: {
MyNewComponent
}
}
</code></pre>
<p>I can't get rid of the <code>Uncaught SyntaxError: import not found: default</code> within the <code>MyNewComponent.vue</code> file</p>
<p>This is how I'm using all my other components, what am I forgetting here? I'm on Vue 2.7</p>
 
Top