0

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.

4
  • It is telling you the file names and the line numbers within those files, where the syntax errors are... Commented Aug 16, 2018 at 23:02
  • Can you please post a minimal reproducible example? Commented Aug 17, 2018 at 4:20
  • @KevinWorkman added it. Commented Aug 23, 2018 at 21:57
  • @Zackary Sorry to be annoying, but a minimal reproducible example is a small example program that you post directly in your question. You'll probably have to do some debugging to narrow down the problem. Commented Aug 23, 2018 at 22:34

1 Answer 1

1

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 */

    }
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.