Closed web-programmer-here closed 2 years ago
@web-programmer-here From your code nothing seems out of the ordinary. Can you share a reproduction on CodeSandbox?
@HusamIbrahim thanks for the quick reply, I tried to create a sandbox but it did not work, I am new to vue and I broke down my template structure like this here is what I created for snadbox https://codesandbox.io/s/prod-field-1imhj?file=/src/components/App/script.js
components
--App
-----index.js
-----script.js
-----component.js
--Content
-----index.js
-----script.js
-----component.js
---index.js
main.js
@web-programmer-here Can you try https://vite.new/vue? Otherwise maybe share a link to a repo
@HusamIbrahim thanks, the project is too big and this map is just part of it, do you know what could cause an issue to give this error: Expected mapDiv of type HTMLElement
? maybe I can debug it that way, also noticed TypeError: e is undefined
in console log
Hard to tell without a reproduction @web-programmer-here . Your code appeared to be working fine, at least when I tried reproducing the issue: https://stackblitz.com/edit/vitejs-vite-qmahue?file=src/components/HelloWorld.vue&terminal=dev
@HusamIbrahim I finally managed to create a sandbox here https://codesandbox.io/s/sample-test-cs7up
I have been trying to figure out what is the issue with this and no luck, been banging my head all day :(
Hey @web-programmer-here Not sure what the issue there is but probably something to do with your webpack config. I tried the Vue CLI scaffolding (webpack based) and your code appears to work there: https://codesandbox.io/s/shy-darkness-2bh96
@HusamIbrahim Thanks, I don't have this issue with other libraries, is there something specific about this one that it may not work with webpack? the webpack setup is pretty basic, I even disabled splitChunks
in configuration but still does not work.
@web-programmer-here This library does work with webpack setups. I use it with a Vue CLI generated project (using webpack on the background) without any issues. Check the following project, maybe it will help you with your setup:
@JoseGoncalves Thanks, yeah this one uses Vue CLI, Husam had a demo with Vue CLI too that worked but something with the webpack when building the project using webpack --mode production
@web-programmer-here I'd try inspecting the webpack config of a standard Vue CLI project and see if you have something misconfigured: https://cli.vuejs.org/guide/webpack.html#inspecting-the-project-s-webpack-config
closing this as I decided to use Vue CLI
Hi, I am trying to use this library but I get this error:
This is how I used it in my content component
am I doing this properly?