Server build import with particular setup #797
-
Hey everyone, Finally adding VPS to my project, and running into issues with the server build import. When I hit a route that the vps middleware should handle, I get:
I've read that page and both linked pages but am still a bit unsure on how to best resolve it for my particular setup. The way my app is setup, I've got a CloudFlare worker in My Vite plugin that does the esbuild for the server outputs the worker file in I've seen that one solution is to manually import it but I'm quite confused as to where I should do that. I realize that this setup is pretty specific, but I also know that's one of the strengths of VPS and why I picked it. I'm hoping someone has some suggestions for how I can debug this further. In the meantime I'll see what I can do to create a minimum example that reproduces my problem. Thank you 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 34 replies
-
AFAICT it should just work. So that's surprising. Set the
Yes: every entry needs it.
That's unexpected as well. What error do you get? What's the content of the file
Most definitely, VPS should be flexible in that regard as well. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the lightning fast reply, one more reason why this project rocks 🔥 Oh interesting, no Definitely sounds like a "me" problem and not VPS, and it sounds like I've got some reading to do on |
Beta Was this translation helpful? Give feedback.
-
Just to give a small update. The current path I'm attempting is:
For now I'm foregoing any HatTip business and just trying to get VPS to run through Miniflare. So far that hasn't been very successful. With the most basic setup https://github.com/alexturpin/vps-mf, Miniflare balks with |
Beta Was this translation helpful? Give feedback.
You need
importBuild.cjs
only for loading the build files atdist/server/
. In dev, you don't needimportBuild.cjs
and instead it's Vite's development server that crawls and dynamically imports the user land files.So it's either you run
$ vite build
and importimportBuild.cjs
, or you instantiate Vite's development server as described here.I believe the question here is whether Vite's devel…