Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

export 'AddPlaceModal' was not found in '~/components/AddPlaceModal.vue'

I just started using nuxt for vue. I added a component in the /components folder and I am trying to use it in one of my pages.

Unfortunately, I get this warning, upon compilation:

"export 'AddPlaceModal' was not found in '~/components/AddPlaceModal.vue'

I am trying to use it via:

<script>
import {mapActions, mapGetters} from 'vuex';
import {AddPlaceModal} from '~/components/AddPlaceModal.vue'; 

export default {
    components: {
        'add-place-modal': AddPlaceModal
    },
...

The component itself looks like:

<script>
export default {
    data() {
        googleLocation: null;
    },
...

Any ideas why this may be?

like image 430
FailedUnitTest Avatar asked Aug 26 '18 01:08

FailedUnitTest


2 Answers

You need to import from default export, not a named export

import AddPlaceModal from '~/components/AddPlaceModal.vue';
like image 139
Aldarund Avatar answered Nov 12 '22 14:11

Aldarund


you have to remove the curly brackets

do this:

Blockquote

instead of:

enter image description here

like image 13
Madiop Niang Avatar answered Nov 12 '22 15:11

Madiop Niang