[Vue warn]: Failed to resolve async component:
See original GitHub issueSimilar to #56, but I do NOT use ES6 export
in my .vue File.
It looks like this (actually this is the “official” Hello World component):
<template>
<p>{{ greeting }} World!</p>
</template>
<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>
<script>
module.exports = {
data: function() {
return {
greeting: "Hello"
};
}
};
</script>
And I try to use it like this:
httpVueLoader.register(Vue, "hello.vue");
While the component does seem to be registered, when running my code I get this:
[Vue warn]: Failed to resolve async component: function() {
return new Component(name).load(url)
.then((component) => component.normalize())
.then((component) => component.compile())
.then((component) => {
const exports = component.script !== null ? component.script.module.exports : {};
if (component.template !== null) { exports.template = component.template.getContent(); }
if (exports.name === undefined) { if (component.name !== undefined) { exports.name = component.name; } }
exports._baseURI = component.baseURI;
return exports;
});
}
Reason: SyntaxError: Unexpected identifier
Any ideas?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:7
Top Results From Across the Web
Dynamic imported vue component failed to resolve
When I try to import a dynamic component with the import() function I receive following error: [Vue warn]: Failed to resolve async ......
Read more >Error with Vue lazy loading components: "Failed to resolve ...
When using Vue async components, and building my application in development mode ( run dev or run watch ) I receive the following...
Read more >Async Component loading not working - Get Help - Vue Forum
Im trying to lazyload some of the components and getting the following error: [Vue warn]: Failed to resolve async component: ()=>t.e(6).then(t.bind(null,126))
Read more >Code Splitting - Failed to resolve async component - Laracasts
I'm having an intermittent problem - I think this is due to webpack & dynamic imports and export functions and other things relating...
Read more >[Solved]-[Vue warn]: Failed to resolve component-Vue.js
You have to either create your Vue.component before the creation of the Vue ViewModel, that is before the new Vue({}) , or create...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Where do I try to modify it? Last code snippet is the error message VueJS throws at me, not my code. Anyways, I have a completely different solution now which works much better for me, i.e. I am transforming the
.vue
Files to ordinary ES6 modules - on the fly - directly on my dev server (usingmod_sed
). No more hoola hoop in the browser 😉 So I won’t be able to replicate my problem anymore. Maybe we can close this one?Possible solution: remove the Lang attribute from the tags: template and style. I had a hard time finding this simple error. That’s for using snippets