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

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

Open
1 of 2 tasks
rxyshww opened this issue Sep 4, 2024 · 3 comments
Open
1 of 2 tasks

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

rxyshww opened this issue Sep 4, 2024 · 3 comments
Labels

Comments

@rxyshww
Copy link

rxyshww commented Sep 4, 2024

Bug report

Packages affected

  • sandpack-client
  • 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
Copy link
Author

rxyshww commented Sep 25, 2024

how to fix it

@rxyshww
Copy link
Author

rxyshww commented Sep 25, 2024

it will be fetch error when url end with ?v=xxx
image

@rxyshww
Copy link
Author

rxyshww commented Sep 25, 2024

It should be caused by timeout. However, setting options={{ bundlerTimeOut: 120000 }} did not take effect.

<Sandpack
      template="vite-react-ts"
      files={{
        "App.tsx": code,
      }}
      customSetup={{
        npmRegistries: [
          {
            enabledScopes: [],
            limitToScopes: false,
            registryUrl: "https://registry.npmmirror.com",
            proxyEnabled: true,
          },
        ],
        dependencies: {
          "@douyinfe/semi-ui": "2.66.1",
        },
      }}
      options={{ bundlerTimeOut: 120000 }}
    />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants