Zackary
Zackary

Reputation: 145

SyntaxError: missing formal parameter with Processing.js, can't find solution

I have been working on a project called LightningOS (a not real operating system written is ProcessingJS) The source code (when I started running into the error) is here on Google Drive.

Here is what the errors are:

SyntaxError: missing format parameter (Images.js:24:16, 'background(0,0,0,0);')
SyntaxError: unexpected token: '(' (LightningOS 0.1.0 Alpha.js:33:18, 'makeNighttimeScene();')
ReferenceError: sketchProc is not defined (LightningOS Alpha.html:26:7, 'shutTimer = 0,')

The program still works if I comment the line makeNighttimeScene();, but this error remains:

Uncaught ReferenceError: background is not defined (at Images.js:24)

I can't figure out where the errors are coming from, as the lines referred to have correct syntax.

My current browser is Firefox 61.0.1+linuxmint1+tara (error also happens on Google Chrome v68).

Any possible solutions for this? The question SyntaxError: missing formal parameter doesn't seem to fix my problem, as its issue was a bad identifier in the function.

Upvotes: 0

Views: 663

Answers (1)

Zackary
Zackary

Reputation: 145

After some debugging, I discovered that the Processing.js functions In Images.js were not being called (which caused the Uncaught RefrenceError). If I commented the background line, I would get the same error but for textSize.

Combining Images.js and LightningOS.js solved all the errors.

Here's what LightningOS.js ended up as after the change:

var sketchProc = function (processingInstance) {
    with(processingInstance) {
        size(1366,768);
        frameRate(60);

        /* code from Images.js */

        /* original LightningOS.js code */

    }
};

Upvotes: 1

Related Questions