Failed to resolve module specifier "cesium"?

Viewed 239

I have a module "Main.js"

import * as Cesium from "cesium";

let map: Cesium.Viewer = undefined;

let createTheMap = function()
{
    if (map === undefined )
    {

        map = new Cesium.Viewer( "mapViewDiv",
            {
                timeline: false,
                animation: false,
                infoBox: false,
                navigationHelpButton: false,
                fullscreenButton: false,
                geocoder: false,
                shadows: false,
                selectionIndicator: false

            });
    }

     map.zoomTo(map.entities);
};

inside the "index.html" i have referenced the main as follow :

 <script src="verot/edi/Main.js" type="module"></script>

and cesium.js as follow:

<script type="module" src="cesium/Source/Cesium.js"></script>

I have set in Visual Studio:

ECMAScript : Ecmascript 6
JSX compilation on TSX file : React
Module System : ES2015

I am receiving the following error :

Uncaught TypeError: Failed to resolve module specifier "cesium". Relative references must start with either "/", "./", or "../".
  • What is causing this error, and how to fix it ?
0 Answers
Related