Open michbarsinai opened 8 years ago
Same error when trying to upload a xml fragment manually using right-click > upload selected. Automatic syncing not working despite .existdb.json file. macOS 10.12.5 eXist-db 3.1.1 atom-server-side 0.2.7 Atom 1.18.0 atom-existdb 0.6
I see this error message from Atom existdb when trying right click > existdb > Upload selected. Here is my stack trace.
TypeError: Cannot read property 'length' of undefined at EXistTreeView.module.exports.EXistTreeView.upload (/home/dl/.atom/packages/existdb/lib/existdb-tree-view.coffee:411:48) at EXistTreeView.upload (/home/dl/.atom/packages/existdb/lib/existdb-tree-view.coffee:1:1) at EXistTreeView.module.exports.EXistTreeView.uploadSelected (/home/dl/.atom/packages/existdb/lib/existdb-tree-view.coffee:408:18) at HTMLElement.EXistTreeView.disposables.add.atom.commands.add.existdb:upload-selected (/home/dl/.atom/packages/existdb/lib/existdb-tree-view.coffee:97:18) at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:384:49) at CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:273:23) at AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/src/atom-environment.js:1351:25) at EventEmitter.outerCallback (/usr/share/atom/resources/app/src/application-delegate.js:346:53) at emitThree (events.js:136:13) at EventEmitter.emit (events.js:217:7)
============================================
I reported a related issue here.
https://github.com/eXist-db/atom-existdb/issues/33
When will these issues be resolved? In interim I am manually uploading files, bypassing existdb client in Atom.
@datavectors This is a community project and so would benefit from the expertise and contributions of its users. PRs are welcome!
Having no experience in debugging Atom packages I am still trying to resolve this error. It appears to be related to loadSync located in /packages/existdb/lib/existdb-tree-view.coffee Line Number: 322 buffer.loadSync()
Deprecation report reads: • The .loadSync instance method is deprecated. • Create a loaded buffer using TextBuffer.loadSync(filePath) instead.
But I don't know how to amend the loadSync code to make it work without errors.
Meanwhile, I have found by experimenting that I can simply drag an xml file located in Atom tree view into eXistdb Database collection. However, I would still like to remove these error messages which may deter other users from adopting this otherwise useful workflow.
I spend some time trying to debug this, just fixing the syntax of loadSync
won't do, the problem is with the async checks for the string.length contents of the buffer in uploadCurrent()
, uploadSelected
, and upload
functions in existdb-tree-view.coffee
There is a flaw in the async logic that tries to evaluate string properties of the textBuffer that aren't set yet. @wolfgangmm this has been broken since 2016 maybe you can take another look.
As it stands now, right-click uploading does not work, drag n drop does which is a workaround .
so this error is only triggered for right-click uploading of xquery files it seems, xml work fine.
Hello,
I have the same issue.
any news on this? Just tried it with a xml file and the problem still seem to exist.
also uploading .xsl files produces the error
Exception thrown when I created a new function at the bottom of a file. This does not seem to reproduce the error, though.
Atom Version: 1.8.0 System: Mac OS X 10.11.5 Thrown From: existdb package, v0.3.3
Stack Trace
Uncaught TypeError: Cannot read property 'length' of undefined
Commands
Config
Installed Packages