Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Not Working in Phonegap #31

Open
narraressan opened this issue Feb 2, 2018 · 5 comments
Open

Not Working in Phonegap #31

narraressan opened this issue Feb 2, 2018 · 5 comments

Comments

@narraressan
Copy link

narraressan commented Feb 2, 2018

Hi. Good evening. Sorry if this is a bit of a novice question but I am a bit lost and would like some expert to advise.

I have a working vue app with this library to load asynch components. However when I experimented on it on phonegap, the components with httpVueLoader("vue/components/mainApp.vue") is not working and not showing in the phonegap mobile preview. However, when I tested it on the browser, its working perfectly...

Here is an example of what I experiemnted...

var vueApp = new Vue({
	el: "#asugfr-app",
	data: {
		txt: "hello world!",
	},
	components: {
	     "myComponent": { template: "<div>A custom component!</div>" },
	     "mainApp": httpVueLoader("vue/components/mainApp.vue")
        },
	methods: {},
	mounted: function(){ 
		console.log("App is running!");
	},
	watch: {}
});

the component loads perfectly in both phonegap preview and browser, however, only works in browser.

Any suggestions or ideas of I am doing wrong?

@FranckFreiburger
Copy link
Owner

can you see any errors in the console ?

@jahrralf
Copy link

jahrralf commented May 24, 2019

Same here

D/SystemWebChromeClient: file:///.../cordova-hot-code-push-plugin/2019.05.24-16.47.55/www/libs/vue-2.6.10/vue-dev.js: Line 634 : [Vue warn]: Failed to resolve async component: function () {

                                     return new Component(name).load(url)
                                         .then(function (component) {

                                             return component.normalize();
                                         })
                                         .then(function (component) {

                                             return component.compile();
                                         })
                                         .then(function (component) {

                                             var 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;

                                             return exports;
                                         })
                                 }

Well, nnot same. It worked when I did a clean build of the app and did not use cordova hot-code-push. But with it, it does not work any more. I can see in the Chrome remot device debug tools that the vue file is found correctly. Any hints?

@jahrralf
Copy link

http-vue-loader, the awesome piece of software, also works in my cordova app. No changes were necessary. However, it is a HTTP view loader. loading from file:// did not work for me, had to get the .vue files from a webserver.

The strange issue with cordova-hot-code-push is still unclear.

@pedromacarmo
Copy link

I have the same issue. Any suggestions?

@Trukes
Copy link

Trukes commented Dec 15, 2020

Add solution on a pull request #123

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants