docson icon indicating copy to clipboard operation
docson copied to clipboard

Multiple widgets in a html page doesn't work

Open Bjwebb opened this issue 5 years ago • 2 comments

<script src="/js/widget.js"   
        data-schema="schema1.json">
</script>  
<script src="/js/widget.js"
        data-schema="schema2.json">      
</script>                                             

Fails with:

Uncaught Error: only one instance of babel-polyfill is allowed

Bjwebb avatar Mar 14 '19 07:03 Bjwebb

This issue was opened by @Bjwebb after my question at https://stackoverflow.com/questions/54706831/how-to-use-docson-widget-with-sphinx-on-readthedocs

Although I would like to have this issue solved, I reverted back to v1.1.0 of Docson and the problem disappears.

I didn’t study it in detail, but I seem to be able to avoid this by using src/widget.js instead of public/js/widget.js. Why does widget.js need to go through webpack anyway, it looks pretty self-contained and browser-compatible at a glance?

cwalther avatar Sep 26 '19 08:09 cwalther