Hello,
As I stated in a previous post, I update cesium to 1.7 in my angular 9 project.
I was using @types from cesium, and I now switched to the built in typing from cesium module.
The problem I face is this, in angular 9 importing cesium do not work.
If I improt anything from cesium like import { Color } from 'cesium';
at build time I will get thrown the following
WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js 52:12-19
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js 80:25-32
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
WARNING in ./node_modules/cesium/Source/Core/buildModuleUrl.js 106:14-21
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
ERROR in ./node_modules/cesium/Source/Core/Resource.js
Module not found: Error: Can’t resolve ‘http’ in ‘D:\Crocsx\Documents\Repository\UIDEV-9\node_modules\cesium\Source\Core’
ERROR in ./node_modules/cesium/Source/Core/Resource.js
Module not found: Error: Can’t resolve ‘https’ in ‘D:\Crocsx\Documents\Repository\UIDEV-9\node_modules\cesium\Source\Core’
ERROR in ./node_modules/cesium/Source/Core/Resource.js
Module not found: Error: Can’t resolve ‘zlib’ in ‘D:\Crocsx\Documents\Repository\UIDEV-9\node_modules\cesium\Source\Core’
caused by the following
// Note: only the 'json' and 'text' responseTypes transforms the loaded buffer
/* eslint-disable no-undef */
var URL = require("url").parse(url);
var http = URL.protocol === "https:" ? require("https") : require("http");
var zlib = require("zlib");
/* eslint-enable no-undef */
Is there any way to bypass those error