Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Why "error Image is not defined" in svelte local, but working in REPL?

$
0
0

I'm getting this error:

ReferenceError: Image is not defined

The code is in a component and looks like this:

    // Preload images    for (const name in images) {      (new Image()).src = images[name]    }

The only thing I did is a exact copy of this working REPL in local, there it works but in local it doesn't. These lines are under the piece.svelte component.

I'm very new at js, I imagine I'm missing some basics. Any Idea?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>