最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to Deploy Openlayer app to azure app service windows via vs code? - Stack Overflow

programmeradmin2浏览0评论

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,
  }),
});

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,
  }),
});
Share Improve this question asked Jan 19 at 2:16 user28409312user28409312 132 bronze badges 1
  • Please Provide Logs of the logstream. – Aslesha Kantamsetti Commented Jan 19 at 2:27
Add a comment  | 

1 Answer 1

Reset to default 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

Azure Output:

发布评论

评论列表(0)

  1. 暂无评论