sandpack icon indicating copy to clipboard operation
sandpack copied to clipboard

local: http://127.0.0.1:3002, Some resources always fail to load

Open rxyshww opened this issue 1 year ago • 3 comments

Bug report

Packages affected

  • [ ] sandpack-client
  • [x] sandpack-react

Description of the problem

When i use sandpack, Some resources always fail to load. :

local: http://127.0.0.1:3002

"use client";
import React from "react";
import { Sandpack } from "@codesandbox/sandpack-react";

const code = `
import { Button } from '@douyinfe/semi-ui';

export default function App() {
  return (
    <>
        <Button type='primary'>primary button</Button>
    </>
  );
}
`;

const SandpackExample = () => {
  return (
    <Sandpack
      template="vite-react-ts"
      files={{
        "App.tsx": code,
      }}
      customSetup={{
        npmRegistries: [
          {
            enabledScopes: ["@douyinfe"],
            limitToScopes: true,
            registryUrl: "https://registry.npmmirror.com/",
          },
        ],
        dependencies: {
          "@douyinfe/semi-ui": "latest",
        },
      }}
    />
  );
};

export default SandpackExample;

image

But after I click the refresh button many times, it might succeed once. and it has goog work in [codesandbox.io] (https://codesandbox.io/p/devbox/upbeat-gagarin-55n4sw?file=%2FApp.tsx&utm_medium=sandpack)

image

rxyshww avatar Sep 04 '24 18:09 rxyshww