javascripthtmlpaperjs

paper.js causing Reference Error with typo that has been corrected


I've been using javascript and paperscript to make a test program and have an interesting problem. I got this error message: Uncaught ReferenceError: veiw is not defined, I realised that I had mis-spelled view and corrected it in my code. But for some reason the error message persised, I've restarted my computer and used ctrl+f to search for 'veiw' in my files, but still the error message persists. Here is my current code:

console.log("Hi");
view.onFrame = function(event){
    project.importSVG('.../mario.svg');
};
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <script src="./scripts/paper-full.js"></script>
    <script type="text/paperscript" src="./scripts/script.js" canvas="myCanvas"></script>
</head>
<body>

<canvas id="myCanvas" width="200" height="100"
style="border:1px solid #d3d3d3;">
</canvas>
</body>
</html>

And I don't know if this is relevant but there seems to be a file generated by paper js each time the webpage is loaded called VM followed by a number.

document.__paperscript__ = function(paper,project,setup,clear,paper) {var module = { exports: {} }; veiw.onFrame = function(event){
    project.importSVG('.../mario.svg');
};
//paper.setup(htmlCanvas);
//paper.project.clear();
//paper.project.importSVG('mario.svg');
return module.exports;
}

As you can see both the type and a few comments that have since been removed from the source file are still here. But I have saved the file and reloaded the page (using the url:http://localhost:8000/html.html with python's http.server running the server). I am clueless as to what is causing this, and I can't find a reference to veiw anywhere in any of my files. Please help me. I'm being haunted by a typo I made a week ago. It won't go away.


Solution

  • I figured it out. And I'm posting this so other people don't have the same problem. This occurs because chrome, which I am using saved webpages so they load faster, so when you change your code... it recognises that it is the same page and doesn't load the new stuff. This can be fixed by going to your chrome history chrome://history/ and clicking 'clear browsing data' then click 'advanced' select 'cached images and files' and unselect everything else, then just set the time at the top so that you don't delete too many things you don't want to.

    NOTE: Doing this wont delete any important data, the only reason not to select 'Time range: ALL TIME' is so that webpages load faster, which is the reason this data is stored in the first place.