-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pin esm to older version? #42
Comments
React is prebundled, so you can't change it I'm afraid. |
I can pin the version of tldraw like this - import { Tldraw } from "@tldraw/tldraw";
+ import { Tldraw } from "@tldraw/tldraw@1.29.2"; but that will cause the exact same problem. |
There might be the another option to bring jupyter-tldraw back to life: Updating the widget to import ipyreact
class Tldraw(ipyreact.ReactWidget):
_esm = """
import * as React from "react";
import { Tldraw } from "https://esm.sh/@tldraw/tldraw@canary";
export default function App() {
return (
<div
style={{
position: "relative",
width: "800px",
height: "350px",
}}
>
<Tldraw />
</div>
);
}
"""
Tldraw() gives now a new error:
asking about this error at the esm discord got me the answer:
@maartenbreddels : Would you have some minutes to put these puzzle peaces together with me? Even if we successfully puzzle things together, there's only a 50:50 chance tldraw-v2 will work on ipyreact, so I can also totally understand when you don't want to spend your bandwidth on this. That said, I think that the correct import map in the widget should look like this:
but this just loads forever and throws an error in the console
|
wuuuhuuu! |
Cool, do you know what the issue was? |
i broken |
I'm super happy that jupyter tldraw-v1 is now running again, thanks a lot @ije for this quick fix! While we're on it, jupyter tldraw-v2 (the "canary" version) was never working before, but it would be awesome to make this work as well! :)
|
ipyreact is so cool |
Absolutely!!! :) |
Oh, while going through the gallery, I just noted that the mafs react component is now broken with v128.
from that code:
in case that you want to have a look at this @ije , here is a online Jupyter demo for reproducing this error: https://kolibril13.github.io/jupyter-mafs/lab?path=01_example.ipynb |
where the sepcifier |
The error message from tldraw-v2 is
The error message from mafs is
As these two packages are completely different react packages but have the same specifier problem, I think that this error comes somewhere from ipyreact. |
I tried with version 0.4:
And still get an error making me believe esm.sh still has some issues, making a bundle using esbuild https://github.com/widgetti/ipyreact?tab=readme-ov-file#bundled-esm-modules should be used here (or using anywidget if you do not care about composability of react components) |
Jupyter-tldraw broke at one point within the last 8 days:
I've checked and the latest tldraw-v1 release (v1.29.2) was 3 months ago, so it's likely an esm.sh issue.
The latest esm.sh relase was 3 days ago (v127) https://github.com/esm-dev/esm.sh/releases , and that's very likely the case why jupyter-tldraw broke.
Therefore, the question: Is there a way to pin the esm version to v126 in ipyreact?
@ije suggested
import * as React from "react?pin=v126";
on the esm.sh discord, but that did not work.The outcome from the conversation on discord was, that pinning the version might not work because react is not provided in import maps, and there were two questions asked on discord: How is react being prebundled? Where's/how's it downloading the files?
The text was updated successfully, but these errors were encountered: