I may have found the solution to my problem and to this one as well: ReferenceError: define is not defined (ver: 1.102.0)
I had the problem starting around version 1.100 as well. There was a change in the static files. But my static files were copied manually month ago, so changes were not taken over after the update to the new version of cesiumjs.
Is there any script i could use to copy them at “npm run build”? Or maybe Cesium could implement this into the run build process? Or just give a big hint in releases if a change to the static files occured? Because i think it doesnt change often, so connecting it with every run build could be ressource straining. @Gabby_Getz
Anyway, I created a new repo, copied the static files manually from node to public (fresh files after npm install of 1.117) and made it fill out the entire screen. Clean starter.
Live: https://metaverse-seed.pages.dev/ (already implemented my basic stuff on top, but the code below, is still untouched inside my code)
Cesium.svelte
<script lang="ts">
import { onMount } from 'svelte';
import { Cartesian3, createOsmBuildingsAsync, Ion, Math as CesiumMath, Terrain, Viewer } from 'cesium';
import '../node_modules/cesium/Build/Cesium/Widgets/widgets.css'
Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWYxN2ViMy00ZmM2LTQzNjMtOGZhZC02NDg2ZmY5MDY4MGMiLCJpZCI6MjE1NzcxLCJpYXQiOjE3MTU4OTUxNTd9.29sj9Ay7XCd14X0Z9s-15mMTqcZX1l-PkVo5NHqCKh8';
window.CESIUM_BASE_URL = './';
let viewer: Viewer;
onMount(async () => {
viewer = new Viewer('cesiumContainer');
});
</script>
<main id="cesiumContainer">
</main>
<style>
main{
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
}
</style>
index.html
<!doctype html>
<html lang="en">
<head>
<title>Title</title>
<meta charset="UTF-8" />
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
<!-- These meta tags are Apple-specific, and set the web application to run in full-screen mode with a black status bar. Learn more at https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="title" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="icon" href="/favicon.png" />
</head>
<body>
<div id="app" style="margin: 0;padding: 0;"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>