You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
3.29.0
Plugin version
3.0.0-beta.23
Node.js version
16.15.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
archlinux
Description
hi,
I'm using fastify-vite with typescript, and after building for production (with command vite build --outDir dist/server --ssr /index.ts) I get the following error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/me/mon-app/client/dist/server/index.ts' imported from /home/me/mon-app/node_modules/.pnpm/fastify-vite@3.0.0-beta.23/node_modules/fastify-vite/mode/production.js
To fix it I made a quick and dirty fix in mode/production.js
@@ -49,7 +49,7 @@
// Loads the Vite application server entry point for the client
async function loadClient () {
- const serverFile = join('server', basename(config.clientModule))+ const serverFile = join('server', basename(config.clientModule).replace('.ts', '.js'))
const serverBundle = await import(resolve(config.bundle.dir, serverFile))
return serverBundle.default ?? serverBundle
}
maybe I miss some configuration step.
Steps to Reproduce
to reproduce use any example and rename client/index.js to client/index.ts then run
vite build --outDir dist/server --ssr /index.ts
Expected Behavior
No response
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
3.29.0
Plugin version
3.0.0-beta.23
Node.js version
16.15.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
archlinux
Description
hi,
I'm using fastify-vite with typescript, and after building for production (with command
vite build --outDir dist/server --ssr /index.ts
) I get the following error:To fix it I made a quick and dirty fix in
mode/production.js
maybe I miss some configuration step.
Steps to Reproduce
to reproduce use any example and rename client/index.js to client/index.ts then run
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: