Khan / Khan/live-editor

Images fail to load without a string literal containing its full name

Open
#678 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

For example, the program below will fail with `Image 'creatures/OhNoes' was not found` until a string literal containing "OhNoes" in its entirety appears anywhere in the program.

```
image(getImage('creatures/Oh' + 'Noes'), 0, 20);

for(var i = 0; i < 3; i++){
var avatar = 'creatures/Hopper-' + ['Cool', 'Happy', 'Jumping'][i];
image(getImage(avatar), i * 140, 200);
}

// var a = "creatures/" + 'OhNoes';
// var b = {"Hopper-Cool": 0};
// var c = '#####Hopper-HappyHopper-Jumping#####';
```

Try uncommenting the last three lines one by one.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the example in the issue and trace the image/getImage asset lookup in the live editor. Verify the behavior with the concatenated names shown, then confirm that images load without a full-name string literal and that existing image loading still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.