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

Webpack compile error: TypeError: __WEBPACK_IMPORTED_MODULE_1__ … is not a function

  • Thread starter Thread starter Lukas
  • Start date Start date
L

Lukas

Guest
So, this my Api Service Component, I'm using Axios:

Code:
import api from './Api.vue';

export default {
    name: 'app-feed-service',
    methods: {
        getPosts() {
            return api.get('posts/');
        }
    }
}

and some feed component

Code:
import AppSinglePost from './../Feed/Post.vue';
import AppFeedService from './../../api/Feed.vue';

export default {
    name: 'app-posts',
    components: {
        AppSinglePost
    },
    data() {
        return {
            posts: []
        }
    },
    created() {
        AppFeedService.getPosts().then((res) => {
            console.log(res);
        });
    }
}

and now the error:

Code:
TypeError: __WEBPACK_IMPORTED_MODULE_1__api_Feed_vue___default.a.getPosts is not a function

can anybody help?

<p>So, this my Api Service Component, I'm using Axios:</p>

<pre><code>import api from './Api.vue';

export default {
name: 'app-feed-service',
methods: {
getPosts() {
return api.get('posts/');
}
}
}
</code></pre>

<p>and some feed component</p>

<pre><code>import AppSinglePost from './../Feed/Post.vue';
import AppFeedService from './../../api/Feed.vue';

export default {
name: 'app-posts',
components: {
AppSinglePost
},
data() {
return {
posts: []
}
},
created() {
AppFeedService.getPosts().then((res) => {
console.log(res);
});
}
}
</code></pre>

<p>and now the error:</p>

<pre><code>TypeError: __WEBPACK_IMPORTED_MODULE_1__api_Feed_vue___default.a.getPosts is not a function
</code></pre>

<p>can anybody help?</p>
 

Online statistics

Members online
0
Guests online
5
Total visitors
5
Top