GMOD / jbrowse-plugin-template

Template to quickly start a new JBrowse 2 plugin
https://jbrowse.org/
Apache License 2.0
4 stars 0 forks source link

Unable to use default export in current jbrowse-plugin-template #45

Open cmdcolin opened 6 months ago

cmdcolin commented 6 months ago
import Plugin from '@jbrowse/core/Plugin'
import FeatureRendererType from '@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType'

console.log({ FeatureRendererType })

class DoesntWork extends FeatureRendererType {}

export default class TemplatePlugin extends Plugin {
  name = 'TemplatePlugin'

  install() {
    // @ts-expect-error
    const t = new DoesntWork({})
    console.log(t)
  }

  configure() {}
}

the output of the console.log shows that the "default export" is on FeatureRendererType.default

cmdcolin commented 6 months ago

might also even occur without default exports sometimes

user reported

"import { FeatureRendererType } from "@jbrowse/core/pluggableElementTypes/renderers""
But I kept getting:
"TypeError: CoreRender requires a renderer that is a subclass of ServerSideRendererType"

And putting this instead fixed it, similar to the other case:
"import { FeatureRendererType } from '@jbrowse/core/pluggableElementTypes'"

I've got rectangles for genes now! Once the imports and everything are in place the drawing isn't too bad, I'll work on it a bit tomorrow.