-
Notifications
You must be signed in to change notification settings - Fork 27
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
Importing GmapCustomMarker not working #15
Comments
Hey ! Can you share your compilation error please ? The only thing I think that may not work properly in your case is you may have missed the Hope this helps, otherwise a stacktrace will sureley help me understand what is happening to your project. |
Works like a charm! Thank you so much! :) My mistake for not thinking about that! |
hi @eregnier , @ekinbukulmez i get the same issue with importing the plugin the error is
i used the latest version. |
@pribadi1st I just retested the last version of the component on the gh-page branch and it seems to work properly. I think the error is on your side also no one else had this issue until now. Your error looks like a bad configuration of your webpack that may not load .vue files properly. The hint is in your stack trace that the syntax error is encountered with the < character that this component uses for html markup. If you can share some code, I may have a look. |
I have the same error in nuxt |
Hi @r29taheri , This issue is related to the parent project https://github.com/xkjyeah/vue-google-maps as the error that raises nuxt is an import error from I had a look at what I can do by setuping a new nuxt project with this plugin, and I had the same issue. However, I did not find any workaround for it. I also am not sure to well understand the issue as it is nuxt related, and I do not master it. You may follow changes in the vue gmap project, or have a deeper look at the issues in it where maybe someone found a solution. You also may try to fix the issue once for all, what would be great for both projects :) . I wish you good luck and I am sorry to not be able to help you more at the moment for this case. Regards. |
I had the same error and this worked for me: //nuxt.config.json
[...]
build: {
transpile: [/^vue2-google-maps($|\/)/, /^vue2-gmap-custom-marker($|\/)/]
}
[...] I'm posting it because I couldn't find a solution for this anywhere. |
Hey @pniedzwiedzinski, thank you for your time and sharing the information! I hope this will help. |
this worked for me, thanks |
I encountered a related issue using this module with Nuxt. We were using the above transpile config fine before, but after updating to
The solution was to import the component from the vue file path directly: import GmapCustomMarker from 'vue2-gmap-custom-marker/gmap-custom-marker.vue'; // works 🎉 instead of from the package index: import GmapCustomMarker from 'vue2-gmap-custom-marker'; // stopped working ❌ |
Hey @sgarner , There was no recent changes on index.js which is this plugin entry point that just loads the On the other hand, this module packaging system is almost non existent and pretty raw, as I never needed one and there was no complaints about it among users. Except for Nuxt users that seems to have a workaround. Let me know If we have some suggestion to improve things. |
This didn't work for me, but i was able to solve this issue with registering the component in a nuxt.js plugin. |
the same |
Could you please give exact steps for this?
I then used this plugin in my nuxt.config.js file like so:
However I still get the same error
Please help! |
If you still have the error, It must be that the transpile directive is not properly used.
import GmapCustomMarker from 'vue2-gmap-custom-marker/gmap-custom-marker.vue';
Does this solve your issue ? |
Thank you for the help, but no, importing the package by appending "/gmap-custom-marker.vue" doesn't change anything... Thank you |
Ok I found the issue :)
🎉 |
I was a bit too fast. 😭 |
Luckily I found it again! So for any nuxt.js noobs out there.
🎉 |
Thank you for sharing. |
It is exactly this that is not working - specifically when using nuxt.js... ( at least in my case - I hope someone will prove me wrong ) |
Hello!
I am trying to use a Vue component as a map marker on a Vue2 Gmap. I used the method described in the docs to import the feature but when I try to import it like so:
I get a syntax error and my code is not able to compile. I tried to import it in the same way that the regular GmapMarker is imported:
but the export was not found. Is there any other way I can successfully implement this on my project?
Thanks in advance!
The text was updated successfully, but these errors were encountered: