question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vue warn]: Failed to resolve async component:

See original GitHub issue

Similar 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:open
  • Created 4 years ago
  • Reactions:8
  • Comments:7

github_iconTop GitHub Comments

1reaction
alphanullcommented, Apr 30, 2019

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 (using mod_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?

0reactions
anyjaimcommented, May 23, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found