Open Angelelz opened 6 months ago
Hi @Angelelz
Thanks. I'll try to fix this issue later.
The same problem: https://github.com/mugi-tech/honox-blog-template/issues/1
I found a workaround / solution:
ssr: {
external: ["adm-zip", "mssql", "sanitize-filename"],
},
Add that to the backend
packages that use require on the server part of vite.config.ts
Feel free to close the issue. It's working fine for me.
Hi @Angelelz
This error comes from the lack of CommonJS support by Vite. It is better to write the appropriate package name in ssr.external
as you did.
I'm hitting a wall trying to make my server do the stuff I need it to do with packages that are written in commonjs using require. I'm not super familiar with vite's bundling process so there's little I can investigate here.
The error I'm getting is:
[vite] Internal server error: require is not defined