PDA

View Full Version : JSBuilder 3 create jsb works from URL but not from file System



jej2003
11 Jan 2012, 2:38 PM
I'm trying to run the jsbuilders create command to build a jsb3 file but get the following error when I run locally:
undefined:0 TypeError: 'null' is not a constructor

if I deploy my app to a web server and run against the full address it works
index.html. Also if I change the stores:[] tag to the equivalent requires tag it seems to work (although with a more complex application I run into other issues). Anyone have any thoughts for how to solve this?


<html>
<head>
<title>Hello Ext</title>

<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>


app.js


Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'HelloExt',
stores :[
'AutoCompleteStore'
],
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
title: 'Hello Ext',
html : 'Hello! Welcome to Ext JS.'
}
]
});
}
});

app/store/AutoCompleteStore


Ext.define('MyApp.store.AutoCompleteStore', {
extend: 'Ext.data.Store',

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'AutoCompleteStore',
proxy: {
type: 'ajax',
extraParams: {
format: 'json'
},
url: '/autocomplete',
reader: {
type: 'json',
root: 'matches'
}
},
fields: [
{
name: 'value'
},
{
name: 'highlightedValue'
}
]
}, cfg)]);
}
});

mitchellsimoens
12 Jan 2012, 10:51 AM
I personally have not run into this, what if you run it from localhost instead of having to put it into the full address? The only thing I could think of is if your page is a server side script and not HTML

jej2003
12 Jan 2012, 10:57 AM
If I run it from localhost it works as well, I just can't run it from the filesystem.

PureWhiteAsian
18 Jan 2012, 8:17 AM
I have the same problem, except that when I run it through the filesystem, it just gets stuck. I even checked the Task Manager and it isn't using any of the CPU resources. So then, I tried it with the URL and it worked.

The only difference between my index.html and yours is that I used ext-debug.js instead of ext-all-debug.js.

Also, my app folder contains more folders than just controller, store, model, and view. I have a util and an action folder. I heard that if you didn't follow the folder structure exactly, then the jsbuilder wouldn't work through the filesystem. Is this true?

mitchellsimoens
18 Jan 2012, 9:36 AM
The folder structure must follow the class names, that is what drives the entire thing.

leecop
22 Mar 2012, 12:25 PM
If I run it from localhost it works as well, I just can't run it from the filesystem.

Same here

McQuack_82
30 May 2012, 4:03 PM
I'm having the same issue

I've tried these variation for file path all should translate the same in my context. I have a copy of the SDK tools located under my project directory to allow this.

file:///C:/Projects/eWoc/omc2/ewoc/src/Ewoc/index.html Fails
http://localhost:54786/index.html Works
..\..\src\Ewoc\index.html Fails
C:\Projects\eWoc\omc2\ewoc\src\Ewoc\index.html Fails

I'm using the SDK 2.0 Beta 3 version
Due to our build process the option that works does not fit well.

McQuack_82
1 Jun 2012, 8:30 AM
Adding the ability to reference the app.js file via the file system would be a nice feature for people using dynamic languages like php, aspx and do not want the depency on a web server during build process. I have an application that I would like to use the sdk tools in an automated build without the web server being ran at build time.