DeveloperError: Width must be less than or equal to the maximum texture size (0). Check maximumTextureSize

Hello your guys,

This is demo in the sandcastle.

I using cesium@1.1.136 in my project, that is runing ok ,until I delete node_modules folder and execute `pnpm i`, the cesium was borken , when rending some icons on the map , it show`DeveloperError: Width must be less than or equal to the maximum texture size (0). Check maximumTextureSize.` .

I watch the version in the Cesium object , it show 1.1.136 ,but , it show 1.1.140 in the window.CESIUM_VERSION, I don’t know why.

Hi xulayen,

Thank you for using the Cesium forum and posting your sandcastle example and a screenshot of your issue.

Can you please try the following?

  1. Check that only one Cesium version is used

    • After running pnpm i, sometimes two Cesium versions get bundled.

    • This is why you see Cesium.VERSION = 1.136 but window.CESIUM_VERSION = 1.140.

    • When two versions are loaded, WebGL can fail to start correctly.

  2. Make sure Cesium assets are copied correctly

    • Cesium requires the Assets, Widgets, and Workers folders at runtime.

    • Please also double‑check that CESIUM_BASE_URL points to the correct path.

    • If these files are missing, Cesium cannot initialize WebGL and maximumTextureSize becomes 0.

  3. Do not mix import methods

    • If you import Cesium from npm, avoid also loading it with a <script> tag.

    • Please use only one method.

This error is not related to icon size.
It usually means Cesium or WebGL did not initialize correctly, often due to asset loading or version mismatch.

Hope this helps β€” let us know what you find!

First and formost , Thanks for you answer me detailly. But sadly, It is shows only one version that I use.

Secondly, I use the way No. 1 that you mentioned , I check the version use the pnpm list cesium --depth=10 what it shows like this β€” Only one version of Cesium in my project.

terjin/components link:packages/components
β”œβ”€β”¬ @cesium-extends/measure 1.1.4
β”‚ β”œβ”€β”¬ @cesium-extends/drawer 1.3.8
β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/subscriber 1.1.1
β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/tooltip 1.2.3
β”‚ β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”œβ”€β”¬ @cesium-extends/subscriber 1.1.1
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”œβ”€β”¬ @cesium-extends/tooltip 1.2.3
β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ └── cesium 1.136.0 peer
└─┬ @cesium-extends/subscriber 1.1.1
└── cesium 1.136.0 peer

devDependencies:
@cesium-extends/measure 1.1.4
β”œβ”€β”¬ @cesium-extends/drawer 1.3.8
β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”œβ”€β”¬ @cesium-extends/subscriber 1.1.1
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”œβ”€β”¬ @cesium-extends/tooltip 1.2.3
β”‚ β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ └── cesium 1.136.0 peer
β”œβ”€β”¬ @cesium-extends/subscriber 1.1.1
β”‚ └── cesium 1.136.0 peer
β”œβ”€β”¬ @cesium-extends/tooltip 1.2.3
β”‚ β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ β”‚ └── cesium 1.136.0 peer
β”‚ └── cesium 1.136.0 peer
└── cesium 1.136.0 peer
@cesium-extends/subscriber 1.1.1
└── cesium 1.136.0 peer
@cesium-extends/tooltip 1.2.3
β”œβ”€β”¬ @cesium-extends/common 1.0.2
β”‚ └── cesium 1.136.0 peer
└── cesium 1.136.0 peer
cesium 1.136.0

This is my way to use the cesium assets in the vite.config.ts ( a Vue3 config file like some config file in React projectοΌ‰file. It has same effect when I use window.CESIUM_BASE_URL = 'libs/Cesium/' instead of coping to the libs folder in vite.config.ts config file .


const cesiumSource = '../node_modules/cesium/Build/Cesium'
// This is the base url for static files that CesiumJS needs to load.
// Set to an empty string to place the files at the site's root path
const cesiumBaseUrl = 'cesiumStatic'

// https://vite.dev/config/
export default defineConfig({
  define: {
    // Define relative base path in cesium for loading assets
    // https://vitejs.dev/config/shared-options.html#define
    CESIUM_BASE_URL: JSON.stringify(`/${cesiumBaseUrl}`),
  },
  plugins: [
    tailwindcss(),
    vue(),
    vueJsx(),
    // vueDevTools(),
    // Copy Cesium Assets, Widgets, and Workers to a static directory.
    // If you need to add your own static files to your project, use the `public` directory
    // and other options listed here: https://vitejs.dev/guide/assets.html#the-public-directory
    viteStaticCopy({
      targets: [
        { src: `${cesiumSource}/ThirdParty`, dest: cesiumBaseUrl },
        { src: `${cesiumSource}/Workers`, dest: cesiumBaseUrl },
        { src: `${cesiumSource}/Assets`, dest: cesiumBaseUrl },
        { src: `${cesiumSource}/Widgets`, dest: cesiumBaseUrl },
      ],
    }),
  ],
  assetsInclude: ['**/*.gltf', '**/*.glb'],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },

  server: {
    host: true,
    allowedHosts: ['pc-local.xxx.com'],
    hmr: {
      overlay: true,
      clientPort: 5173,
    },
  },
})

I check my project that only use import method ,I don’t use <script> tag in the index.html.

Hello again, Travis.Crowell:

I tried to upgrading my version continuously.My project was successful when I upgraded my version to 1.140 directly.Anyway, I success although I don’t know why too.

Thank you very much!