elements icon indicating copy to clipboard operation
elements copied to clipboard

Unable To Use "Stoplight Elements" In React Vite App - `require is not defined`

Open aerialist7 opened this issue 2 years ago • 0 comments

Hi Team,

we're using <API/> react component from @stoplight/elements in our Vite/React project. But the app doesn't work in production - it fails with Uncaught ReferenceError: require is not defined error.

Sample: https://github.com/aerialist7/stoplight-elements-sample/tree/vite-react-component To reproduce the issue just run preview command in my sample.

Could you please help us to fix it?

relates #2084 cc @lottamus

aerialist7 avatar Aug 12 '22 06:08 aerialist7