Closed Mgrmjp closed 2 years ago
Hi @Mgrmjp
There's was a typo in the documentation website and readme file about import
statement, sorry for that.
It's fixed now, you can import like so:
import jsVectorMap from 'jsvectormap'
import 'jsvectormap/dist/maps/world.js'
const map = new jsVectorMap({
selector: '#map',
map: 'world',
})
Still doing the same even after changing the import. 😢
Thank you for letting me know about this issue!
It looks like it's failing, starting from v1.4.0 when using ESM or CJS modules, but it works just fine on HTML files.
As a temporary workaround you can do so:
import jsVectorMap from "jsvectormap"
window.jsVectorMap = jsVectorMap
import "jsvectormap/dist/maps/world-merc"
const map = new jsVectorMap({
selector: "#map",
map: "world_merc"
})
That didn't seem to help either. 😂
Maybe it's something on my end. 🤷🏻♂️
🤷🏻♂️
Try to change the jsvectormap version to 1.4.4, the issue is still present.
@rushenn Gonna publish a new version today which fixes the issue.
Please update to v1.4.5 https://iqp6rj.csb.app/
Barebones project and trying to use the package. Getting this in console:
Downgrading to 1.3.3 worked, but what might be the problem?
Importing like so:
Installed via npm. Node version 14.19.0.