Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in nextTick: "TypeError: to is undefined" #10

Closed
ruben82 opened this issue Oct 5, 2018 · 4 comments
Closed

Error in nextTick: "TypeError: to is undefined" #10

ruben82 opened this issue Oct 5, 2018 · 4 comments

Comments

@ruben82
Copy link

ruben82 commented Oct 5, 2018

Hi there,
I'm trying to add your interesting component, but I have a problem and I cannot understand why.
When I try to add it, I receive

"[Vue warn]: Error in nextTick: "TypeError: to is undefined"

And, at the end, this one

onAdd CustomMapMarker.vue:108 eu.prototype.draw https://maps.googleapis.com/maps-api-v3/api/js/34/10/intl/it_ALL/overlay.js:4:383 fu.prototype.Ob https://maps.googleapis.com/maps-api-v3/api/js/34/10/intl/it_ALL/overlay.js:5:175 vt https://maps.googleapis.com/maps-api-v3/api/js/34/10/intl/it_ALL/map.js:37:364 yt/< https://maps.googleapis.com/maps-api-v3/api/js/34/10/intl/it_ALL/map.js:38:346

Did you encounter this issue before?
Could you help me please?

Thanks in advance

@ruben82
Copy link
Author

ruben82 commented Oct 5, 2018

Hi there, I solve it.
I found the hypothetical bug.
I think maybe is righter to put $mapPromise in the mounted hook and not in the provide.
At the row 108, you use a div that is not mounted at the DOM yet, so it's null.
I changed provide method with mounted, and it works fine.
I hope this help

@eregnier
Copy link
Owner

eregnier commented Oct 5, 2018

I never had this issue before.
You may be right with the appropriate moment where trigger the mapPromise.
there is no reference to a to variable in the component.
Is your map properly loaded by the way ?
I will think about changing the trigger moment and I have to test it before, but I am surprised you are the only one to meet this issue at the moment.

@eregnier
Copy link
Owner

I think I understand the issue now. this component requires both the dom to be mounted AND the map to be ready. I should trigger the callback code once both ran to ensure the component is really ready to run.

@eregnier
Copy link
Owner

Problem solved on your side, I'll implement this if any more issues of the same type arrives from users. The component seems to works properly at the moment

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

No branches or pull requests

2 participants