No Valid Render Function Found!

My code from v2 seems to not want to port to the V3… I am getting the above error message across multiple patterns. Any ideas on what might be going on?


I’ve seen this a couple of times using the Pixelblaze 3 with a 16x16 matrix and the default matrix mapping function. It comes and goes w/2D patterns. At one point as an experiment, I just coded a 1D render function:

render(index) { ; }

into 2D patterns that didn’t have one, and haven’t seen the problem since.

I get that error message for any 2D calls in any pattern I have tried to load into the v3.

For example, @zranger1 , your code for Task #6 -

export function render2D(index,x,y) {

In all cases I get a “Looks ok, pattern is live!” message.

Why would an “error” like this come and go? This does not seem acceptable. I do not know what to do with your suggestion above.

I was having enough challenge figuring out how to simply map into 2 and 3D on my V2, given time and brains constraints …

For example: This code is shown and “live” in the mapper -

function (pixelCount) {
width = 8
var map = []
for (i = 0; i < pixelCount; i++) {
y = Math.floor(i / width)
x = i % width
x = y % 2 == 1 ? width - 1 - x : x //zigzag
map.push([x, y])
return map

And it provides an entree to 3D… but I have no idea how to actually implement it, no fully-fleshed discussion is given, only something about the code being out in your browser. So, being a novice, I just have no idea what to do in a time-effective manner.


If I paste the following as a new pattern in V3-land, running a 16x16, I get the fading rainbow, but the first row and a half are dark.

export function render2D(index, x, y) {
    hsv(x, 1, y)

lets break the problem down:

  1. you always need a render() (even if it’s not really used)

  2. you don’t always need a render2D() or render3D(), but if you specify them, you need to have a map that has 2d or 3d coordinates or it’ll give you problems. If you give both, PB is supposed to pick the one matching your mapping (based on number of coordinates given in the map)

  3. as for mapping, that’s ‘real’ JS code, and all it is supposed to do is return a set of arrays, coordinates in 2d or 3d… if you are having problems with it, check your settings. We have other discussions on mappings, so I’d start there.

Thanks for getting back @Scruffynerf . I appreciate it.

All the code I am trying to transpo to the V3 has render calls
All the render2D code I am trying to transpo works on the V2
None of it works on the V3.

That is the first problem.

This really helps as I see this code specifying both 2D and 3D render and did not know what was going on.

Yes, OK. But I was/am puzzled as to where this map code goes and how it integrates with the other operating pattern code. Like, how does the mapper integrate with your other code?

By the way, I doubt I will ever be a brilliant or even smart programmer. First, I want to design and build a 3D pattern pattern testbed of approximately 1024 Px, integrated with a (scrolling) matrix display, perhaps some UI.

That’s my present goal. I wouldn’t mind getting up to some speed with programming but there are many more people like yourself who smarter than me and already up to speed… so, with a little help from my friends I may build something.

ps I will indeed pore through the search results for “mapping” on the forum. I’m pretty sure there is a wealth of info there.

Hi @JustPete,
The pixel map is a set of coordinates that tell Pixelblaze where your pixels live physically (in 2D or 3D). The pixel map is a static list of coordinates. That is to say, it doesn’t change once configured.

You can enter those coordinates as a JSON formatted array, like: [[1,2], [3,4], ...]. Alternatively, you can also use some JavaScript code that generates that same array of coordinates. Once the coordinates are generated, that code doesn’t run again. This is handy if you don’t want to type them out, which can be tedious and boring, especially if they follow a regular pattern like the 8x8 panels.

There’s no interaction with the pattern code, other than the resulting coordinates tell the pattern where each pixel is via the render2D / render3D functions.

1 Like

OK. So the mapper page/code is a “live feed” to whatever pattern you have running. This was not clear until I messed with it a while. Fantastic, that works! Perhaps there is another way… also?

Am still getting the “No Valid Render Function” error with the V3.
Settings are as follow:
WS2812 neopixel/
256 Px
800 kbps (the only data speed offered)

Are there any other pertinent settings to look at?

The mapper does live update the pixel map when you edit the contents. After that, any code in the mapper tab doesn’t run. These coordinates are then fed in to render2D or render3D depending on how many dimensions are defined in the map. A pattern can have any combination of render functions exported, and it looks for a render, render2D, and render3D.

The “No Valid Render Function” error doesn’t care about the LED types or pixel counts. This can happen if the pattern doesn’t export an appropriate render function for the loaded pixel map.

For instance, if your pattern only has render2D, it will not work with a 3D pixel map. Likewise with render3D and a 2D map. If your pattern has a plain old render exported, then it will be used when it can’t find a better fit, or if there is no pixel map.

For broad compatibility, a pattern can export all 3 functions, and the appropriate render will be called depending on what pixel map is loaded (or not loaded).

I’m still pretty sure I’ve seen the “No Valid Render Function” intermittently on patterns and maps that work perfectly on PB2. It doesn’t seem to happen on patterns with at least both render() and render2d() exported.

I’ve just switched to Pixelblaze 3 for my “main” development – my feeling is that the web environment is not yet as stable as the PB2’s. On Windows 10 Firefox, I get periodic glitches, dropping of web socket connection to the browser and the occasional hang that requires a Pixelblaze restart to recover. Being as it’s a brand new product on a brand new hardware platform, this is not unexpected, and I’ve been working around it without really paying attention. I’ll put some time in and try to come up with a 100% repro case and/or some actual data this week!

1 Like

No, it’s not. It doesn’t pay any attention to your pattern. It’s ONLY displaying the points it’s been told and runs a basic rainbow iteration thru them.

Many make that mistake, I’ve seen it before here.
Might need to clarify that better on mapper page.

and this statement

… could be resolved somewhat through this

What would be helpful is a schematic or whatever coders call it of operational block logic and sequence/relationship of parts such as how and when to use mapper and how it affects/is inserted in/ported to pattern code, how and when to use a JSON array and etc.

Thank you for thinking of it!

I will note, that changing the mapper type does live-change the pattern appearance on my 16 x 16, per the first statement above, for lots of good looks!

That sounds interesting… whatever repro is… :smile:

Let me/us know if you figure some stuff on the rendering of 2D (3D?) code. I’d be interested to here just if/how weird or not my v3 behavior is.

@JustPete, “repro” is just short for reproduce – having a “repro case” means that you have documented a way to reproduce a problem at will. It makes it much easier for the developer to fix, especially in the case of intermittent bugs, which tend to hide if they see the programmer coming…

On the 2D/3D thing, make sure you’ve got your mapping function set up and saved, reload the pattern, and if that doesn’t fix it, try adding dummy render functions to the pattern for any dimensionality it doesn’t already have. Below are suitable “dummy” functions for 1D, 2D and 3D. Just copy the functions you need at the bottom of the pattern.

export function render(index) { hsv(0,1,1); }   // all red
export function render2D(index,x,y) { hsv(0.6667,1,1) ; }  // all blue
export function render3D(index,x,y,z) { hsv(0.333,1,1); }  // all green

These can also help as diagnostics: If you paste in only the missing render functions, and your display suddenly turns all red, green or blue, it indicates that your map may not be set up correctly.


Code was running well this morning, but later became glitchy.

Did you sacrifice the 3 chickens required, a red, a green and a blue one? PB tends to slow down if you don’t refresh the chickens periodically.

Officially, Pixelblaze does not require any chicken (or other animal) sacrifices.

Only human sacrifices are required, in the form of free-time… And perhaps the occasional singed skin when soldering.


I think those chickens did some real good. (Unofficially, of course). That added peacock tongue and eye of newt didn’t hurt either.

There must be a happy butterfly flapping its wings somewhere in Mongolia…

Fantastic news! No render errors and code just chugging along, happy as can be for over 18 hours now.

Some pretty fine work you all are doing here, and much appreciated, generous help.

I am reminded, “With a little help from my friends”. Kudos and thanks, folks!

Now off to 3D-land.

1 Like

I also have seen this “no valid render function” when trying a few downloaded patterns on my V3 running a single 588 pixel strip of WS2815s. For instance on the “Firework Nova” pattern I got this error every time I tried to load the file.