Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error due to "constrain" not being defined in the current scope #23

Open
nopivnick opened this issue Apr 21, 2021 · 0 comments
Open

Error due to "constrain" not being defined in the current scope #23

nopivnick opened this issue Apr 21, 2021 · 0 comments
Assignees
Labels
bug Something isn't working p5

Comments

@nopivnick
Copy link
Owner

🌸 p5.js says: There's an error due to "constrain" not being defined in the current scope (on line 98 in display.js [http://localhost:3000/scripts/display.js:98:3]).

If you have defined it in your code, you should check its scope, spelling, and letter-casing (JavaScript is case-sensitive). For more:
https://p5js.org/examples/data-variable-scope.html
https://developer.mozilla.org/docs/Web/JavaScript/Reference/Errors/Not_Defined#What_went_wrong
p5@1.1.9.js:46374 ▶️ Error at line 98 in "updateAlpha" in display.js (http://localhost:3000/scripts/display.js:98:3)

▶️ Called from line 224 in "updateOutput" in sketch.js (http://localhost:3000/sketch.js:224:3)

▶️ Called from line 35 in "Socket.<anonymous>" in sockets.js (http://localhost:3000/scripts/sockets.js:35:3)

▶️ Called from line 1761 in "Socket../node_modules/component-emitter/index.js.Emitter.emit" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1761:20)

▶️ Called from line 1160 in "Socket.emitEvent" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1160:61)

▶️ Called from line 1134 in "Socket.onevent" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1134:14)

▶️ Called from line 1086 in "Socket.onpacket" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1086:16)

▶️ Called from line 1761 in "Manager../node_modules/component-emitter/index.js.Emitter.emit" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1761:20)

▶️ Called from line 526 in "Manager.ondecoded" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:526:62)

▶️ Called from line 1761 in "Decoder../node_modules/component-emitter/index.js.Emitter.emit" in socket.io@3.1.2.js (http://localhost:3000/libraries/socket.io@3.1.2.js:1761:20)


p5@1.1.9.js:46741 Did you just try to use p5.js's constrain() function? If so, you may want to move it into your sketch's setup() function.

For more details, see: https://github.com/processing/p5.js/wiki/p5.js-overview#why-cant-i-assign-variables-using-p5-functions-and-variables-before-setup
display.js:98 Uncaught ReferenceError: constrain is not defined
    at updateAlpha (display.js:98)
    at updateOutput (sketch.js:224)
    at Socket.<anonymous> (sockets.js:35)
    at Socket../node_modules/component-emitter/index.js.Emitter.emit (socket.io@3.1.2.js:1761)
    at Socket.emitEvent (socket.io@3.1.2.js:1160)
    at Socket.onevent (socket.io@3.1.2.js:1134)
    at Socket.onpacket (socket.io@3.1.2.js:1086)
    at Manager../node_modules/component-emitter/index.js.Emitter.emit (socket.io@3.1.2.js:1761)
    at Manager.ondecoded (socket.io@3.1.2.js:526)
    at Decoder../node_modules/component-emitter/index.js.Emitter.emit (socket.io@3.1.2.js:1761)
@nopivnick nopivnick added bug Something isn't working p5 labels Apr 21, 2021
@nopivnick nopivnick self-assigned this Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p5
Projects
None yet
Development

No branches or pull requests

1 participant