Closed stampaaaron closed 1 year ago
[vite] Error when evaluating SSR module [...]/node_modules/telefunc/dist/cjs/node/vite/importGlob/telefuncFilesGlob.js
That's the culprit: node_modules/telefunc/
shouldn't be processed by Vite. Did you add Telefunc to Vite's ssr.noExternal
?
Thanks for the quick reply. Haven't tried that, but it doesn't seem to change anything, I still get the error.
I tried it with just telefunc
and node_modules/telefunc
:
ssr: {
noExternal: ['node_modules/telefunc'],
},
Make Sure Vite doesn't process node_modules/telefunc/
(which is Vite's default behavior).
Alternertively, provide a minimal reproduction and I'll have a look at it.
Closing in the meantime.
For an admin UI of one of our projects I'm trying to setup a SSR vite application inside a module of an existing NestJS project.
For that I was trying to make this example of yours work inside my nest environment: https://github.com/brillout/telefunc/tree/main/examples/vite-plugin-ssr
The Idea is to use the same express server as the NestJS application and use the vite middleware on it.
NestJS Server Setup:
Instead of configuring the endpoints needed for
telefunc
andvite-plugin-ssr
directly on the express server, I was hoping to add those to a NestJS Controller.DashboardController:
DashboardService:
Like this I managed to get the
vite-plugin-ssr
working (which is awesome already :)).With
telefunc
I got the following Error when I was trying to do a request:After this I tried to add the
vite-plugin-commonjs
to the vite configuration, because I thought it might have something to do with NestJS still using commonjs.Vite Configuration:
This seemed to have fixed my original Error from before, but it lead me to this new Error:
At this point, I don't know how to proceed with this internal error. Does this still have something to do with commonjs/esm?
I'm a big fan of the concept of
telefunc
and I would really appreciate your support. Thanks in advance!