{"record":{"id":"9e0f7a1131623c3a","repo":"BabylonJS/Babylon.js","slug":"image-url-is-not-set","errorCode":null,"errorMessage":"Image url is not set","messagePattern":"Image url is not set","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Textures/equiRectangularCubeTexture.pure.ts","lineNumber":69,"sourceCode":"     * @param onError — defines a callback called if there is an error\r\n     * @param supersample — defines if texture must be supersampled (default: false)\r\n     * @param sphericalPolynomialTargetSize — target face size for spherical polynomial computation. 0 = full resolution (default).\r\n     */\r\n    constructor(\r\n        url: string,\r\n        scene: Scene,\r\n        size: number,\r\n        noMipmap: boolean = false,\r\n        gammaSpace: boolean = true,\r\n        onLoad: Nullable<() => void> = null,\r\n        onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n        supersample = false,\r\n        sphericalPolynomialTargetSize = 0\r\n    ) {\r\n        super(scene);\r\n\r\n        if (!url) {\r\n            throw new Error(\"Image url is not set\");\r\n        }\r\n\r\n        this._coordinatesMode = Texture.CUBIC_MODE;\r\n        this.name = url;\r\n        this.url = url;\r\n        this._size = size;\r\n        this._supersample = supersample;\r\n        this._noMipmap = noMipmap;\r\n        this.gammaSpace = gammaSpace;\r\n        this._onLoad = onLoad;\r\n        this._onError = onError;\r\n        this._sphericalPolynomialTargetSize = sphericalPolynomialTargetSize;\r\n\r\n        this.hasAlpha = false;\r\n        this.isCube = true;\r\n\r\n        this._texture = this._getFromCache(url, this._noMipmap, undefined, undefined, undefined, this.isCube);\r\n\r","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Textures/equiRectangularCubeTexture.pure.ts#L51-L87","documentation":"EquiRectangularCubeTexture builds a cube texture from an equirectangular (panorama) image URL. The constructor requires a URL because the texture cannot be initialized from nothing; if the url argument is falsy (undefined, null, or empty string), the constructor throws immediately.","triggerScenarios":"Calling new EquiRectangularCubeTexture(url, scene, ...) with url undefined, null, or \"\" — typically because a config value or asset path variable was never set.","commonSituations":"Environment variables or import.meta.env values not defined (e.g. missing VITE_HDRI_URL), a loader returning undefined for an optional HDR asset, or typos in option keys so the url falls through as undefined.","solutions":["Ensure the url passed to the constructor is a non-empty string","Check the config/env variable feeding the url is actually defined before constructing the texture","Fall back to a default HDR asset when the intended url is missing","Validate the url with a guard before constructing"],"exampleFix":"// before\nconst envTex = new EquiRectangularCubeTexture(process.env.HDRI_URL, scene, 128);\n// after\nconst hdriUrl = process.env.HDRI_URL;\nif (!hdriUrl) throw new Error(\"HDRI_URL is not configured\");\nconst envTex = new EquiRectangularCubeTexture(hdriUrl, scene, 128);","handlingStrategy":"validation","validationCode":"function buildEnvTexture(url, scene, size) {\n  if (typeof url !== \"string\" || url.length === 0) {\n    throw new TypeError(\"EquiRectangularCubeTexture requires a non-empty url\");\n  }\n  return new EquiRectangularCubeTexture(url, scene, size);\n}","typeGuard":"function hasUrl(v: unknown): v is string {\n  return typeof v === \"string\" && v.length > 0;\n}","tryCatchPattern":"let envTex;\ntry {\n  envTex = new EquiRectangularCubeTexture(url, scene, 128);\n} catch (e) {\n  if (e instanceof Error && e.message === \"Image url is not set\") {\n    console.warn(\"No HDR url configured; skipping env texture\");\n  } else throw e;\n}","preventionTips":["Validate config/env-provided urls before constructing textures","Use TypeScript non-optional string types for url parameters","Provide a default HDR fallback asset"],"tags":["texture","argument-validation","configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}