PDA

View Full Version : Uncaught ReferenceError: SenchaInspector is not defined



jschrock
21 Aug 2015, 7:55 AM
Trying to inspect a local application. Made the changes to the app.json and Application.js files per the tutorial. When I try and launch my application I get the Uncaught ReferenceError: SenchaInspector is not defined error. I have used both the "Machine Name" as well as "localhost" for my configuration. Here is the app.json and Application.js where I have added the code for SenchaInspector. I must be missing something here, but not sure what.

app.json:



"js": [
{ "path": "${framework.dir}/build/ext-all-rtl-debug.js" },
{ "path": "app.js", "bundle": true },

//Sencha Inspector code
{
// default settings
//"path" : "http://localhost:3000/inspector.js",
// Or Use your Machine Name "path" : "http://MyComputerName:3000/inspector.js",
// Or Use your IP Address //"path" : "http://123.456.78.90:3000/inspector.js",

"remote" : true,
"bootstrap" : true
}
],

Application.js:


launch: function () {
SenchaInspector.init('http://localhost:3000/inspector.js');

other code....
}

arthurakay
21 Aug 2015, 9:39 AM
I had to edit your code in order to better read it... and if I have done so correctly, the "path" to inspector.js in your app.json is commented out.

jschrock
21 Aug 2015, 10:15 AM
This was a copy and paste error on my part. The code that I am using does not have the path commented out. My code in fact is as follows:


"js": [
{ "path": "${framework.dir}/build/ext-all-rtl-debug.js" },
{ "path": "app.js", "bundle": true },

//Sencha Inspector code
{
// default settings
"path" : "http://localhost:3000/inspector.js",
// Or Use your Machine Name
//"path" : "http://MyComputerName:3000/inspector.js",
// Or Use your IP Address
//"path" : "http://123.456.78.90:3000/inspector.js",

"remote" : true,
"bootstrap" : true
}
]

arthurakay
21 Aug 2015, 10:35 AM
Did you run "sencha app refresh" in Sencha Cmd?

jschrock
21 Aug 2015, 11:28 AM
53069I am not running the application through the sencha web server. I have the code running in Eclipse with a Tomcat server. I have modified the code and clean and built the project and also bounced the Tomcat server. Here is a screenshot of the structure of my project. Shouldn't it pick up the changes once I bounce the server without having to run a cmd refresh?

arthurakay
21 Aug 2015, 11:33 AM
Honestly I don't know much about using a project in Eclipse with Tomcat... but "sencha app refresh" is almost always required when you edit app.json.

If this route continues to be problematic for you, I'd encourage you to try the bookmarklet as noted in the docs. That doesn't require any changes to your application code.