Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databaseNamed problem #102

Open
ramoriusvt opened this issue Aug 20, 2015 · 1 comment
Open

databaseNamed problem #102

ramoriusvt opened this issue Aug 20, 2015 · 1 comment

Comments

@ramoriusvt
Copy link

I'm implementing the latest (1.2.1) version of the titouchdb binaries into the TouchBooksAlloy tutorial and have hit a wall. It doesn't matter whether I'm running iOS or Android, in both cases it is looking for a method, 'databaseNamed', that doesn't exist. From what I've been able to ascertain, I think it needs to exist in the compiled titouchdb code.

I'm running this on Titanium 3.5.1.
Thank you,
Rob

<On a side note, the instructions to create the model Books, are no longer applicable. Apparently, now you need to create the model as a 'property' model, then change the 'type' in the adapter properties. This threw me for a loop, until I found another tutorial that did it this way.>

@ramoriusvt
Copy link
Author

Here's the error in iOS:
[INFO] : Launching iOS Simulator
[INFO] : Project built successfully in 1m 20s 146ms
-- Start simulator log -------------------------------------------------------
[INFO] : Application started
[INFO] : TouchBooksTutorial/1.0 (3.5.1.96875c9)
[INFO] : TiTouchDB | Couchbase Mobile version 1.0 (unofficial)
[ERROR] : Script Error {
[ERROR] : column = 30;
[ERROR] : line = 26;
[ERROR] : message = "undefined is not a function (evaluating 'server.databaseNamed(config.adapter.dbname)')";
[ERROR] : sourceURL = "file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/sync/titouchdb.js";
[ERROR] : stack = "InitAdapter@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/sync/titouchdb.js:26:30\nbeforeModelCreate@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/sync/titouchdb.js:99:16\nM@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy.js:124:82\nfile:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/models/Book.js:37:16\nglobal code@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/models/Book.js:44:70\nrequire@[native code]\ncreateCollection@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy.js:272:24\nController@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/controllers/book_list.js:78:39\ncreateController@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy.js:264:54\nController@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy/controllers/index.js:31:50\ncreateController@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/alloy.js:264:54\nglobal code@file:///Users/macbook/Library/Developer/CoreSimulator/Devices/BA1F2C67-1CC3-4658-BA5F-671F3492408E/data/Containers/Bundle/Application/1B5D4E09-0501-4E86-9048-2F6F2B3E36FE/TouchBooksTutorial.app/app.js:15:23";
[ERROR] : }
[ERROR] : Script Error Module "alloy/models/Book" failed to leave a valid exports object
[ERROR] : ErrorController is up. ABORTING showing of modal controller

And Android:
[ERROR] : TiExceptionHandler: (main) [723,723] ----- Titanium Javascript Runtime Error -----
[ERROR] : TiExceptionHandler: (main) [1,724] - In alloy/sync/titouchdb.js:1,69
[ERROR] : TiExceptionHandler: (main) [1,725] - Message: Uncaught TypeError: Object # has no method 'databaseNamed'
[ERROR] : TiExceptionHandler: (main) [0,725] - Source: equired adapter configuration property: collection_name"),db=server.databaseNa
[ERROR] : V8Exception: Exception occurred at alloy/sync/titouchdb.js:1: Uncaught TypeError: Object # has no method 'databaseNamed'
[WARN] : Sync: com.couchbase.lite.replicator.ReplicationInternal$9@41add1a0: error getting remote checkpoint
[ERROR] : Sync: com.couchbase.lite.replicator.PullerInternal@41a79e20: Progress: set error = org.apache.http.client.HttpResponseException: Unauthorized
[ERROR] : Sync: PullerInternal stopGraceful.run() finished

And I just determined that this has previously been reported in #98. At least now I know that I'm not the only one having this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant