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

Viewed 8772

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?

2 Answers

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

import AddPlaceModal from '~/components/AddPlaceModal.vue';

you have to remove the curly brackets

do this:

Blockquote

instead of:

enter image description here

Related