jonluca / vite-typescript-ssr-react

🚀 A Vite Typescript SSR React boilerplate!
https://blog.jonlu.ca/posts/vite
342 stars 48 forks source link

Failed to load asset when serving #27

Closed yngwi closed 1 year ago

yngwi commented 1 year ago

Hi, when doing yarn run serve in a new codespace with the template, I get a Failed to load url /assets/index-396a04c2.js (resolved id: /assets/index-396a04c2.js). Does the file exist? error in the console. This file does exist in dist/assets so I don’t know what it is about.

jonluca commented 1 year ago

Fixed in https://github.com/jonluca/vite-typescript-ssr-react/commit/11516fbe16a6a34b85f113f785bde4ee460a1500

yngwi commented 1 year ago

Thank you. I now have the problem that I cannot import into server.ts, I try to use code from inside src but I get the following error when using yarn serve:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/work/dist/src/config/env' imported from /work/dist/server.js

Can you help mo resolve this, it worked before.