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

rebuild indexes error #111

Closed
nevf opened this issue Jan 21, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@nevf
Copy link

commented Jan 21, 2019

I've copied the code from https://nanosql.gitbook.io/docs/query/rebuild-index changing the table name and I've tried both the streaming and non-streaming versions and both give the following error.

Uncaught (in promise) TypeError: Cannot read property 'type' of undefined
    at _nanoSQLQuery._getRecords (query.ts:1778)
    at Array.<anonymous> (query.ts:1869)
    at _nanoSQLQueue._progressBuffer (utilities.ts:361)
    at _nanoSQLQueue.newItem (utilities.ts:383)
    at query.ts:1859
_nanoSQLQuery._getRecords @ query.ts:1778
(anonymous) @ query.ts:1869
_nanoSQLQueue._progressBuffer @ utilities.ts:361
_nanoSQLQueue.newItem @ utilities.ts:383
(anonymous) @ query.ts:1859
async function (async)
el_rebuild_indexes.onclick @ tree_app.js:269

The secondary index has been deleted from IndexedDB.

My Config is:

    const result = await nSQL().connect( {
        id: "tree_app",     // db name
        mode: "PERM",       // PERM uses best backend db for this client
        tables: [
            {
                name: "tree",
                model: {
                    "id:string": {pk: true},
                    "name:string": {default: ''},
                    "icon:string": {},
                    "bg_color:string": {}, 
                    "state:obj": {
                         model: {
                            "expanded:bool": { default: true }
                        }
                    },
                    "users:int": {},
                    "description:string": {},
                },
                indexes: {
                    "name:string": {unique: true} 
                }
            }
        ],
    })

I'm using V2.0.6 installed today.

@ClickSimply

This comment has been minimized.

Copy link
Owner

commented Jan 21, 2019

Just released 2.0.7 to npm, this issue should be resolved and I've added a few tests to make sure this doesn't come up again.

Again thanks for all your help Neville!

@nevf

This comment has been minimized.

Copy link
Author

commented Jan 21, 2019

@ClickSimply Thanks for the quick update, however I'm unable to install the new version.

c:\webapps\play2\clibu_tree>npm i @nano-sql/core --save
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! path c:\webapps\play2\clibu_tree\node_modules\@nano-sql\core\dist\cli.js
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod 'c:\webapps\play2\clibu_tree\node_modules\@nano-sql\core\dist\cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\NevRED\AppData\Roaming\npm-cache\_logs\2019-01-21T11_30_13_036Z-debug.log
@ClickSimply

This comment has been minimized.

Copy link
Owner

commented Jan 21, 2019

Yeah I saw that just after I published it, issue caused by the new CLI.

Try now, should be solid with v2.0.8.

@nevf

This comment has been minimized.

Copy link
Author

commented Jan 21, 2019

Just updated to 2.0.9 and all is well both with the install and the rebuild indexes error. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.