Open kwabe007 opened 3 months ago
Looking into this. Can you share a bit more about your dev environment (OS, node, yarn ver), so I can try to replicate this?
Just in case, I bumped the main package versions on the template, update package.json and see if that make any difference: https://github.com/manawiki/repay/commit/0905869ee19c6064cf74c448837e8b35a515d30d
It still does not work after updating the package versions.
Environment: Ubuntu 22.04.4 LTS (jammy) Node v20.11.1 yarn v1.22.21
Got the same problem while trying to build a docker image from the project. In the docker image I use pnpm instead of yarn.
Docker Environment: node:20.11.1-alpine pnpm v8.15.4
Looks like this is a type issue with Remix. We can skip it for now by adding // @ts-expect-error in server.ts
:
createRequestHandler({
// @ts-expect-error
build: vite
? () => vite.ssrLoadModule("virtual:remix/server-build")
: await import("./build/server/index.js"),
getLoadContext(req, res) {
https://github.com/manawiki/repay/commit/08b5e4f7f5072a679d75077795a7235ac7f7c3fe
I'll dig a bit further in this, we might need a PR into Remix core to completely resolve this.
Now that you mention it, I don't think I've checked if the bug exists on the Remix Vite template. I can check it a bit later.
Looking at the Remix Vite template I see that the code for handling SSR requests is different:
// handle SSR requests
app.all("*", remixHandler);
And it works fine building with a resource route.
Hi, it seems the build process breaks when a project contains a resource route (A route that does not export a component).
To reproduce:
import { redirect } from "@remix-run/node";
export function loader() { return redirect('/'); }
If you do however add an empty export:
The build process works fine. Resource routes are valid routes in Remix so RePay should support it as well. For now I'll just remember to add an empty component export to my routes but hope to see this fixed :)