Error on line 71 of p5.dom.js showing in console

I was working through a project on The Code Train involving rocket telemetry simulation, and the createP() function would not execute. I was coding on Atom and viewing the results in Google Chrome, so I pulled up the console and received the following error: CANNOT READ PROPERTY ‘PROTOTYPE’ OF UNDEFINED at line 71 of the p5.dom.js file. I also have the p5.js file linked in my index.html file. I took a look at the source code and found no apparent syntax error. Has anyone else encountered this problem? I prefer to use an editor other than codepen for portability and functional reasons.

Answers

  • I'm pretty sure someone posted the same error recently (it is somewhat unusual/unexpected) and it turned out they'd loaded the script files in the wrong order. So, just in case, see: using a library.

  • Thanks Blindfish. The order of the files was indeed the root of the problem. I really enjoy the visualizations that are possible with this platform, and so it's great that it was so easily remedied. I'm in the early throws of web development, so I have much to learn.

  • edited December 2017

    The link below is an online sketch example which is kickstarted by a minimum usable "index.html".
    Plus it uses createP() in order to display the contents obtained from loadJSON(): O:-)

    http://Bl.ocks.org/GoSubRoutine/9aa9cd00000e331612c8e557b5dd28f0

Sign In or Register to comment.