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

Vite template not working with specific dependency #1046

Open
1 of 2 tasks
YousefED opened this issue Dec 11, 2023 · 0 comments
Open
1 of 2 tasks

Vite template not working with specific dependency #1046

YousefED opened this issue Dec 11, 2023 · 0 comments
Labels
bug Something isn't working triage New issues that needs consideration

Comments

@YousefED
Copy link

Bug report

Packages affected

  • sandpack-client
  • sandpack-react

Description of the problem

I try to create a sandpack example with a depencency for a library I'm working on. It doesn't work with the vite-react-ts template, unless I manually click the "refresh" button

What steps can we take to reproduce the problem?

Go to this example on your website: https://sandpack.codesandbox.io/docs/getting-started/usage#npm-dependencies

Change the code to the following:

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

export default function App() {
  return (
    <Sandpack
      template="react-ts"
      customSetup={{ 
        dependencies: { 
          "@blocknote/react": "latest" 
        }
      }}
      files={{
        "/App.js": `import * as bn from '@blocknote/react' 

export default function App() {
  return JSON.stringify(bn)
}`
      }}
    />
  )
};
  • Notice that the output works and shows some data of the imported package.
  • Now, set template to template="vite-react-ts"
  • The preview page stays empty
  • When you click the sandpack refresh button, the correct content loads
@YousefED YousefED added bug Something isn't working triage New issues that needs consideration labels Dec 11, 2023
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