SSR: Cannot find module 'react' #1071
-
DescriptionI'm currently trying to set up prerendering with Vite and Preact and it always fails when I want to use the ssr plugin in combination with React libraries. Now when I start the application and navigate to the home page I get the following error:
My page
Without SSR everything works fine. Here are my vite.config.ts and package.json: vite.config.ts
package.json
I added the resolve.alias section later to the vite.config.ts, but that had no effect. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
If you want the |
Beta Was this translation helpful? Give feedback.
@dennispost99 See vitejs/vite#14158. In the meantime, a workaround you can try is to manually apply the alias to
node_modules/@mui/
yourself; quite ugly, but I don't see another option here.