Here is the snippet of code I'm working with:
/**
* map.ts
*/
// @deno-types="./libs/@types/geojson/index.d.ts"
// @deno-types="./libs/@types/mapbox-gl/index.d.ts"
mapboxgl.accessToken = "toto";
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v11', // style URL
center: [-74.5, 40], // starting position [lng, lat]
zoom: 9 // starting zoom
});
Despite importing the mapbox definition as follows:
// @deno-types="./libs/@types/geojson/index.d.ts"
// @deno-types="./libs/@types/mapbox-gl/index.d.ts"
I encountered this error:
error: TS2304 [ERROR]: Cannot find name 'mapboxgl'.
mapboxgl.accessToken = "toto";
~~~~~~~~
at file:///home/bussiere/Workspace/testdeno2/map.ts:9:1
TS2304 [ERROR]: Cannot find name 'mapboxgl'.
var map = new mapboxgl.Map({
~~~~~~~~
at file:///home/bussiere/Workspace/testdeno2/map.ts:11:15
Found 2 errors.
How can I correctly import the definition so that I can use the name and its definitions?
Here is the link to the corresponding GitHub repository: https://github.com/bussiere/testdeno2
Edit:
Below is the uncaught error message:
error: Uncaught (in promise) RuntimeError: unreachable
at <anonymous> (wasm://wasm/00247702:1:336403)
at <anonymous> (wasm://wasm/00247702:1:341096)
at <anonymous> (wasm://wasm/00247702:1:339419)
at <anonymous> (wasm://wasm/00247702:1:339781)
at <anonymous> (wasm://wasm/00247702:1:336272)
at <anonymous> (wasm://wasm/00247702:1:268321)
at minify (wasm://wasm/00247702:1:253183)
at minify (https://deno.land/x/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="177a7e797e717e726557612639263926">[email protected]</a>/wasm.js:98:14)
at minify (https://deno.land/x/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e9848087808f808c9ba99fd8c7d8c7d8">[email protected]</a>/mod.ts:27:10)
at https://deno.land/x/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b9d4d0d7d0dfd0dccbf9cf8897889788">[email protected]</a>/cli.ts:53:3
Regards