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

Failed to import - openlayers #818

Open
SOULPWRD opened this issue Apr 4, 2024 · 0 comments
Open

Failed to import - openlayers #818

SOULPWRD opened this issue Apr 4, 2024 · 0 comments
Labels
browser Not working in Browser

Comments

@SOULPWRD
Copy link

SOULPWRD commented Apr 4, 2024

Failing module

import Map from "https://esm.sh/ol/Map";
import View from "https:/esm.sh/ol/View";
import XYZ from "https:/esm.sh/ol/source/XYZ";
import TileLayer from "https:/esm.sh/ol/layer/Tile";

new Map({
  target: 'map',
  layers: [
    new TileLayer({
      source: new XYZ({
        url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
      })
    })
  ],
  view: new View({
    center: [0, 0],
    zoom: 2
  })
});

Error message

After onload I got this:

demo.js:11 
 TypeError: t.then is not a function
    at Hi.setView (https://esm.sh/v135/ol@9.1.0/es2022/Map.js:5:94500)
    at eval (eval at <anonymous> (eval at <anonymous> (eval at self.onmessage (:270:19))), <anonymous>:36:17)
    at https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:22012
    at ke (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:1983)
    at De (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:2051)
    at t.__weh.t.__weh (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:21895)
    at jt (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:3389)
    at Gn (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:13:9934)
    at mount (https://esm.sh/stable/@vue/runtime-core@3.4.21/es2022/runtime-core.mjs:5:30145)
    at An.t.mount (https://esm.sh/stable/@vue/runtime-dom@3.4.21/es2022/runtime-dom.mjs:2:18758)


Additional info

Same behavior also tested on ol@9.0.0.

  • esm.sh version:
  • Browser version:
@SOULPWRD SOULPWRD added the browser Not working in Browser label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

1 participant