Skip to content

Snippet rewrite: handle single-quoted texture and scenes paths in validation_native.js#1699

Open
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:fix-snippet-texture-url-rewrite
Open

Snippet rewrite: handle single-quoted texture and scenes paths in validation_native.js#1699
bkaradzic-microsoft wants to merge 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:fix-snippet-texture-url-rewrite

Conversation

@bkaradzic-microsoft
Copy link
Copy Markdown
Contributor

The URL rewrite rules in Apps/Playground/Scripts/validation_native.js only matched double-quoted texture and scenes paths in playground snippet code. Snippets that use single quotes -- e.g. BABYLON.Texture('/textures/albedo.png') -- slipped past the rewrite and hit raw absolute URLs at load time, producing Error: Unknown error opening URL and a hung snippet-mode retry loop.

This adds single-quote variants for the existing /textures/, textures/, and scenes/ rules so both quote styles get rewritten to the absolute https://playground.babylonjs.com/... form, matching the existing behavior for double-quoted paths. No behavior change for any snippet that already worked.

Verified locally on Win32 D3D11 Release that the snippet which originally hit this error now loads its texture asset and proceeds to the next stage of evaluation (separate, unrelated failure path -- not addressed here).

…ion_native.js

The eval-time URL rewrite rules in validation_native.js only matched
double-quoted texture/scenes paths. Snippets that use single quotes
(e.g. `'/textures/albedo.png'`) slipped through and hit raw absolute URLs,
producing `Error: Unknown error opening URL` at load time.

Added single-quote variants for `/textures/`, `textures/`, and `scenes/`
to mirror the existing double-quote rules. No behavior change for any
snippet that already worked.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant