autoannotate addon error in UMD version
magelan opened this issue · 6 comments
Hi,
trying to get the autoannotate addon working in universal mode.
The linked html example file in the readme does not exist anymore.
https://github.com/TeselaGen/openVectorEditor#full-example
so I build instead on the deployed example and use this code:
<html>
<head>
<link
rel="stylesheet"
type="text/css"
href="https://unpkg.com/open-vector-editor/umd/main.css"
/>
</head>
<body style="display: flex">
<script
type="text/javascript"
src="https://unpkg.com/open-vector-editor/umd/open-vector-editor.js"
></script>
<script
type="text/javascript"
src="https://unpkg.com/ove-auto-annotate/umd/ove-auto-annotate.js"
></script>
<script type="text/javascript">
const editor3 = window.createVectorEditor("createDomNodeForMe", {
autoAnnotateFeatures: window._ove_addons.autoAnnotateFeatures,
withPreviewMode: false,
showMenuBar: true,
editorName: "YetAnotherSequence"
});
/* createDomNodeForMe will make a dom node for you and append it to the document.body*/
editor3.updateEditor({
readOnly:false,
autoAnnotateFeatures: window._ove_addons.autoAnnotateFeatures,
sequenceData: {
name: "Wait for Me!",
circular: true,
sequence:
"gtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaaccccccgtaacccccc",
features: [
{
id: "19f0fjj",
name: "abcd",
type: "RBS",
start: 1,
end: 5
},
{
id: "24t2t",
name: "pj1",
type: "CDS",
start: 10,
end: 50
},
{
id: "82020000",
name: "pj3",
type: "CDS",
start: 10,
end: 50
}
]
}
});
</script>
</body>
</html>
Using the autoannotate function gives me the error popup:
Error annotating feature(s). Double check your file to make sure it is valid!
Even if I use the downloaded examples for both csv and ApE files.
The console error message is:
"index.js:426 error: TypeError: Cannot read properties of undefined (reading 'find')
at _callee2$ (index.js:288:50)
at tryCatch (runtime.js:63:15)
at Generator.invoke [as _invoke] (runtime.js:293:1)
at Generator.next (runtime.js:118:1)
at src_asyncGeneratorStep (ove-auto-annotate.js:1415:107)
at _next (ove-auto-annotate.js:1417:197)
at ove-auto-annotate.js:1417:375
at new Promise ()
at ove-auto-annotate.js:1417:100
at validateRow (index.js:279:31)
at _callee3$ (index.js:364:23)
at tryCatch (runtime.js:63:15)
at Generator.invoke [as _invoke] (runtime.js:293:1)
at Generator.next (runtime.js:118:1)
at src_asyncGeneratorStep (ove-auto-annotate.js:1415:107)
at _next (ove-auto-annotate.js:1417:197)"
Is autoannotate not supported in the UMD version?
Cheers
Franz
Hi Franz,
Thanks for the issue, I'll look into this today and get back to you..
Hi Franz @magelan ,
I think I've found the issue and am releasing a new version of the auto annotate plugin. This should hopefully fix the error you were seeing.
@magelan lemme know if that solves your issue. This was caused by me forgetting to re-publish the auto-annotate package after making a change to it! It might have other issues still possibly..
@tnrich
Well, it solved the issue with the file format message, but just get a white page now, with this error at the console:
Invariant Violation: You should not use or withRouter() outside a
at invariant (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:20097:15)
at Route.computeMatch (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:171084:22)
at new Route (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:171059:20)
at Mg (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82683:172)
at pi (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82729:146)
at ck (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82817:427)
at bk (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82798:347)
at ak (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82798:278)
at Tj (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82798:138)
at Lj (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82791:163)
at https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82671:115
at exports.unstable_runWithPriority (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82882:343)
at gg (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82670:325)
at jg (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82671:61)
at ig (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82670:428)
at Wj (https://unpkg.com/open-vector-editor/umd/open-vector-editor.js:82792:190)
Hmm interesting I wonder what's causing that. I'll need to look into that..