Closed usualoma closed 8 months ago
Hi @usualoma !
This is related to #43.
React is provided as CommonJS, so it cannot be run as-is in Vite. Therefore, you need to specify it in ssr.external
as follows.
export default defineConfig(({ mode }) => {
return {
ssr: {
external: ['react', 'react-dom']
},
plugins: [honox()]
}
})
@usualoma
This is an example project using React!
https://github.com/yusukebe/honox-playground/tree/main/projects/react
@yusukebe Thank you. I got it!
What version of HonoX are you using?
0.1.0
What steps can reproduce the bug?
Follow the example below to set up react and run
npm run dev
. https://github.com/honojs/honox?tab=readme-ov-file#byor---bring-your-own-rendererWhat is the expected behavior?
no error
What do you see instead?
Additional information
The following changes were made to avoid this