Skip to content
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

CDN install does not work with versions after 2.8.0 #1095

Open
1 of 2 tasks
hpohlmeyer opened this issue Feb 27, 2024 · 0 comments
Open
1 of 2 tasks

CDN install does not work with versions after 2.8.0 #1095

hpohlmeyer opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@hpohlmeyer
Copy link

Bug report

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

I have followed the docs on how to install sandbox from a CDN. It works fine with the version specified in the docs (2.8.0), but it fails with any newer version.

The latest version (2.13.2) fails with the following error:

Uncaught TypeError: o is undefined
    h https://esm.sh/v135/@lezer/[email protected]/es2022/lr.mjs:3
    l https://esm.sh/v135/@lezer/[email protected]/es2022/lr.mjs:3
    deserialize https://esm.sh/v135/@lezer/[email protected]/es2022/lr.mjs:3
    <anonymous> https://esm.sh/v135/@lezer/[email protected]/es2022/html.mjs:2
lr.mjs:3:21968

What were you doing when the problem occurred?

Loading the page.

What steps can we take to reproduce the problem?

Open this html file:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script type="importmap">
      {
        "imports": {
          "react": "https://esm.sh/[email protected]",
          "react-dom": "https://esm.sh/[email protected]",
          "react-dom/": "https://esm.sh/[email protected]/",
          "@codesandbox/sandpack-react": "https://esm.sh/@codesandbox/[email protected]"
        }
      }
    </script>
    <script type="module">
      import React from "react";
      import { createRoot } from "react-dom/client";
      import { Sandpack } from "@codesandbox/sandpack-react";

      const rootElement = document.getElementById("root");
      const root = createRoot(rootElement);
      const sandpackComponent = React.createElement(Sandpack, {
        template: "vanilla",
      });
      root.render(sandpackComponent);
    </script>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

Link to sandbox

https://codesandbox.io/p/sandbox/sandpack-bug-repro-53trm3

Your Environment

Software Name/Version
Sandpack-client version
Sandpack-react version 2.13.2
Browser Firefox 123.0
Operating System macOS 14.1.2
@hpohlmeyer hpohlmeyer added bug Something isn't working triage New issues that needs consideration labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that needs consideration
Projects
None yet
Development

No branches or pull requests

1 participant