Skip to content

solara_cdn is broken in vscode #761

@iisakkirotko

Description

@iisakkirotko

Seems like at some point we've had a regression - math rendering, mermaid, griddraggable, and other components that rely on our template this.getCdn / this.getJupyterBaseUrl machinery and requirejs are broken in vscode.

It seems that vscode attempts to load resources with relative paths from the current directory, i.e. for a notebook in /Users/x/Code/example/, it will looks for the cdn in /Users/x/Code/example/_solara/cdn/.

The error then reads something like:

Error: Unable to read file '/Users/x/Code/example/_solara/cdn/@widgetti/[email protected]/dist/index.min.js' (Error: Unable to resolve nonexistent file '/Users/x/example/_solara/cdn/@widgetti/[email protected]/dist/index.min.js')

Within the iframes that render cell contents, we have the following

document.getElementsByTagName("base").length: 1,
document.body.dataset.baseUrl: https://file%2B.vscode-resource.vscode-cdn.net/Users/x/.vscode/extensions/ms-toolsai.jupyter-2024.7.0-darwin-arm64/temp/scripts/973c83f5a03f3bf85c6238a4779b0ccaedd49c55474cf78b500e5991c6c563b4/jupyter/
document.baseURI: https://file+.vscode-resource.vscode-cdn.net/Users/x/Code/example/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions