Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JS issue when using with @blueprintjs/core package #452

Answered by rmorshea
rafaellichen asked this question in Problem
Discussion options

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.

You must be logged in to vote

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

Comment options

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?

You must be logged in to vote
2 replies
Comment options

With that said module_from_template("react", "@blueprintjs/core?module", cdn="https://unpkg.com") is broken - see #455

Comment options

this is helpful; thanks.
Resolved by changing package build method.

Answer selected by rmorshea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /