codesandbox / sandpack

A component toolkit for creating live-running code editing experiences, using the power of CodeSandbox.
https://sandpack.codesandbox.io
Apache License 2.0
4.92k stars 351 forks source link

sandpack doesn't work with the latest vite #959

Open ocavue opened 1 year ago

ocavue commented 1 year ago

Bug report

Packages affected

Description of the problem

I try to open a project with the latest vite and @vitejs/plugin-react in its package.json with <Sandpack/>, but I get the following error:

typeError: _promises2.default.rm is not a function

If I downgrade dependencies to the version in the template, then everything is fine. However, I need to latest vite to support some features in project so I cannot use this older vite version.

What were you doing when the problem occurred?

What steps can we take to reproduce the problem?

I created a repo to reproduce this issue: https://github.com/issueset/sandpack-vitest-bug

$ git clone https://github.com/issueset/sandpack-vitest-bug
$ cd sandpack-vitest-bug
$ pnpm install
$ pnpm dev

And you should see the same error as the following screenshot:

image

Link to sandbox: [link]() (optional)

N/A

Your Environment

Software Name/Version
Sandpack-client version n/a
Sandpack-react version 2.6.9
Browser chrome
Operating System macOS
traviscooper commented 7 months ago

@ocavue Did you find a resolution to this issue?