-
-
Notifications
You must be signed in to change notification settings - Fork 328
JS issue when using with @blueprintjs/core package #452
-
Related issue ticket: palantir/blueprint#4823
I tried to use @blueprintjs/core to render a button in the jupyter notebook with idom, but that results in js error in the browser console.
import idom import idom_jupyter blueprintjs = idom.web.module_from_template("react", "@blueprintjs/core", fallback="...") bpbutton = idom.web.export(blueprintjs, "Button") @idom.component def ShowButton(): return bpbutton() ShowButton()
Tested using this environment: https://mybinder.org/v2/gh/idom-team/idom-jupyter/main?filepath=notebooks%2Fintroduction.ipynb
In the browser console, error: Uncaught (in promise) SyntaxError: Invalid or unexpected token
The error originates from the linked file core.js on: https://cdn.esm.sh/v43/@blueprintjs/core@3.47.0/es2020/core.js
Use text search to find the only code starting with 1.tolocal or t=1; this is where the error starts.
Beta Was this translation helpful? Give feedback.
All reactions
I think this should probably be reported to the authors of blueprintjs since there's not too much that IDOM can do if it doesn't get a valid ES module from the CDN. Perhaps you could try a different CDN? The default is https://esm.sh, but you can change that by setting module_from_template(..., cdn="https://my-cdn.com"). I had issues with https://unpkg.com/, but maybe that would work in this case?
Replies: 1 comment 2 replies
-
I think this should probably be reported to the authors of blueprintjs since there's not too much that IDOM can do if it doesn't get a valid ES module from the CDN. Perhaps you could try a different CDN? The default is https://esm.sh, but you can change that by setting module_from_template(..., cdn="https://my-cdn.com"). I had issues with https://unpkg.com/, but maybe that would work in this case?
Beta Was this translation helpful? Give feedback.
All reactions
-
With that said module_from_template("react", "@blueprintjs/core?module", cdn="https://unpkg.com") is broken - see #455
Beta Was this translation helpful? Give feedback.
All reactions
-
this is helpful; thanks.
Resolved by changing package build method.
Beta Was this translation helpful? Give feedback.