-1

I'm very new to azure,when i deploying simple openlayer app to azure i am facing below issue

 Uncaught TypeError: Failed to resolve module specifier "ol/Map.js". Relative references must start with either "/", "./", or "../".

main.js

import Map from 'ol/Map.js';
import OSM from 'ol/source/OSM.js';
import TileLayer from 'ol/layer/Tile.js';
import View from 'ol/View.js';

const map = new Map({
  layers: [
    new TileLayer({
      source: new OSM(),
    }),
  ],
  target: 'map',
  view: new View({
    center: [0, 0],
    zoom: 2,
  }),
});
1
  • Please Provide Logs of the logstream. Commented Jan 19 at 2:27

1 Answer 1

0

I created simple OpenLayer Application by following OpenLayer documentation and deployed it to Azure App service Windows using Vs Code.

Uncaught TypeError: Failed to resolve module specifier "ol/Map.js". Relative references must start with either "/", "./", or "../".

Even I got the same Issue, to resolve the issue I ran below command to generate Production ready file (dist) and deploy the dist folder to Azure Web App.

npm run build

enter image description here

Azure Output:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.