Live preview is blank. Have looked at all other posts.

edited September 2017 in p5.js Library Questions

This is the code I have written in Brackets:

error

This is what I get at the bottom of my screen i have this index file in the folder:

error2

this is the code inside my index.html:

<!DOCTYPE html> <html> <head> <script src="../p5.min.js"></script> <script src="../addons/p5.dom.min.js"></script> <script src="../addons/p5.sound.min.js"></script> <script src="sketch.js"></script> <style> body {padding: 0; margin: 0;} </style> </head> <body> </body> </html>

I have a sneaking suspicion that either the index is wrong or something is causing it to not read the index file. OR. That for some reason it is showing preview and trying to run it "BEFORE" it loads the index.html. If anyone could help that would be great.

I have the latest Brackets(1.10) and p5.js

Answers

  • Live preview is blank. Have looked at all other posts.

  • edited September 2017

    check the console output (F12 in browser). Could be that you haven't managed the file structure properly and the library files aren't loading: the console will confirm this...

  • I have the same issue like "jessew" described stated above but I cannot find an answer in the link "GoToLoop" provided or what it means what "blindfish" replied in "...check the console output...". Isn't there clear answer on this? I can edit the the sketch.js file in bracket and when i run the index.html, then everything works fine. ...but not with brackets Live View.

  • @thulpe: hit F12 in your browser. By default that should open the console. Look for the output there - e.g. errors about missing files, in particular p5.js ;)

    It's a while since I used Brackets but IIRC the 'live view' test server is local to the defined project folder. If script dependencies - such as p5.js - are outside of this (e.g. the level above) then they won't be delivered to live view and the sketch won't run.

    The solution is to either link to CDN copies of library files, or define your project folder at the same level as any dependencies.

Sign In or Register to comment.