We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55ed78e commit 52bd064Copy full SHA for 52bd064
src/core/main.js
@@ -125,7 +125,12 @@ class p5 {
125
// If the user has created a global setup or draw function,
126
// assume "global" mode and make everything global (i.e. on the window)
127
if (!sketch) {
128
+ if (window.p5 instanceof p5) {
129
+ console.warn('p5.js appears to have been imported multiple times. This could cause errors.');
130
+ return;
131
+ }
132
this._isGlobal = true;
133
+ window.p5 = this;
134
if (window.hitCriticalError) {
135
return;
136
}
0 commit comments