import { getSandpackCssText, SandpackProvider, SandpackThemeProvider, useSandpack, useSandpackTheme, useSandpackNavigation, SandpackCodeEditor, SandpackPreview } from '@codesandbox/sandpack-react';
^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'SandpackCodeEditor' not found. The requested module '@codesandbox/sandpack-react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@codesandbox/sandpack-react';
const { getSandpackCssText, SandpackProvider, SandpackThemeProvider, useSandpack, useSandpackTheme, useSandpackNavigation, SandpackCodeEditor, SandpackPreview } = pkg;
What version of
astroare you using?1.7.2
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Linux
Describe the Bug
Running
npm run buildalways fail when using@codesandbox/sandpack-reactwith the following error:Minimal repo to reproduce the issue here.
I thought this was an issue with how
@codesandbox/sandpack-reactwas packaged, as suggested by publint, but ultimately found that not to be the case because I'm able to build with plain Vite: here's a minimal repro.Link to Minimal Reproducible Example
https://github.com/phelipetls/sandpack-astro/
Participation