Closed gijskant closed 5 years ago
Thanks for the report! Relatively few of our users use a build pipeline, and as a result the importable functionality is under-tested.
I've added the suggested change to a branch in progress; will merge and mark fixed once I have a chance to test this out in a vue app I'm working on.
Thanks for the quick response! Good luck with all development work.
One other note that you may find helpful:
If your custom plot uses the LocusZoom "download image" button feature, it may break when using asset concatenation with the CSS. See #125 for details.
Please let us know if you find any other quirks when using React with LZ.js!
No further response. I'll close this ticket for now, but let us know how this turned out- we're quite open to improving our module support going forward. (many of our older usages were based on globals)
Problem
When embedding LocusZoom in a React app, building or starting the app results in an error:
Locuszoom is imported as a node dependency:
"locuszoom": "^0.8.2"
. The problem seems to be in the module header as defined in wrapper.txt, where the dependency is namedQ
, while node usesq
to refer to the module.Steps to reproduce the issue
Edit
src/App.js
:Run:
Error:
Proposed solution
The problem is solved when changing
'Q'
to'q'
on line 5 in node_modules/locuszoom/dist/locuszoom.app.js.Solution in the source: change line 3 in assets/js/app/wrapper.txt to: