Skip to content

Commit 924396f

Browse files
committed
Warn when using preload
1 parent d17c3ee commit 924396f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/friendly_errors/fes_core.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function fesCore(p5, fn){
8282
const entryPoints = [
8383
'setup',
8484
'draw',
85-
'preload',
8685
'deviceMoved',
8786
'deviceTurned',
8887
'deviceShaken',
@@ -295,6 +294,10 @@ function fesCore(p5, fn){
295294
context = instanceMode ? context : window;
296295
const fnNames = entryPoints;
297296

297+
if (context.preload) {
298+
p5._friendlyError('The preload() function has been removed in p5.js 2.0. Please load assets in setup() using async / await keywords or callbacks instead.', 'preload');
299+
}
300+
298301
const fxns = {};
299302
// lowercasename -> actualName mapping
300303
fnNames.forEach(symbol => {

0 commit comments

Comments
 (0)