-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remix Cloudflare builds should not work on based on the /functions
directory
#9611
Comments
Note The main keypoints here are:
|
The server build for CF doesn't really depend on the The server build you import is just an object conforming to the Remix's ServerBuild interface that's the same regardless if you use CF, Node, Bun or Deno. The |
Note the remix team has agreed on Remix to output to |
When producing deployment/production builds that target Cloudflare, such builds rely on the
/functions
directory, for example see:templates/cloudflare/functions/[[path]].ts
createPagesFunctionHandler
Instead of this, builds should use advanced mode and produce an
_worker.js
directory instead (basic example of the_worker.js
directory).This
Since the
[[path]].ts
file is part of the user facing API this would require user facing changes, as discussed a while back (internal discord thread) a solution could be to introduce acloudflare.ts
/_worker.ts
/etc... file that would be at the root of a Remix project and have such file renamed and moved in the appropriate_worker.js
directory in thebuildEnd
hook.Optionally a
getServerBuild
(or similar) utility (or even a path rewrite on the fly) could be introduced to hide from users the fact that relative import path to the Remix build pre file movement does not actually point to a real fileThe text was updated successfully, but these errors were encountered: