I'm trying to use react-exe in a Vite project, but it fails with the following error:
process is not defined
Console Output

Code i used
import { CodeExecutor } from "react-exe";
const code = `
export default function HelloWorld() {
return (
<div className="p-4 bg-blue-100 rounded">
<h1 className="text-2xl font-bold">Hello World!</h1>
</div>
);
}
`;
function App() {
return <CodeExecutor code={code} />;
}
export default App;
Expected Behavior
It should execute the provided code snippet without throwing any errors.
Actual Behavior
Instead, it crashes with the process is not defined error.
Additional Context
I noticed that the example provided in the documentation uses a client component in Next.js. Since process is not available in client components, I would expect the same error there. Could you clarify how it works in Next.js but fails in Vite?
Let me know if you need more details. Thanks!
I'm trying to use
react-exein a Vite project, but it fails with the following error:Console Output
Code i used
Expected Behavior
It should execute the provided code snippet without throwing any errors.
Actual Behavior
Instead, it crashes with the
process is not definederror.Additional Context
I noticed that the example provided in the documentation uses a client component in Next.js. Since
processis not available in client components, I would expect the same error there. Could you clarify how it works in Next.js but fails in Vite?Let me know if you need more details. Thanks!