netlify / remix-template

Deploy your Remix site to Netlify
83 stars 27 forks source link

chore: add entry.server.tsx to functions template #140

Closed pieh closed 5 months ago

pieh commented 6 months ago

Description

Seems like default Remix server entry is behaving weirdly and is not closing connection after send content and only eventually after 5s (default timeout) connection is closed which is reported as slow response ( https://answers.netlify.com/t/remix-very-slow/115440 )

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

Please replace this line with instructions on how to test your changes

For us to review and ship your PR efficiently, please perform the following steps:

A picture of a cute animal (not mandatory, but encouraged)

netlify[bot] commented 6 months ago

Deploy Preview for remix-edge-on ready!

Name Link
Latest commit 51efb7aa0a8e0034bbd3a01729eab0fe1b7143ae
Latest deploy log https://app.netlify.com/sites/remix-edge-on/deploys/6606fe0cb2caa90009e0f8ac
Deploy Preview https://deploy-preview-140--remix-edge-on.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 6 months ago

Deploy Preview for remix-on ready!

Name Link
Latest commit 51efb7aa0a8e0034bbd3a01729eab0fe1b7143ae
Latest deploy log https://app.netlify.com/sites/remix-on/deploys/6606fe0cb2caa90009e0f8ae
Deploy Preview https://deploy-preview-140--remix-on.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

kennygoff commented 6 months ago

Left a comment on that Support thread with this but the remix-adapter already exports this functionality in handleRequest and old versions of the template (see a5ca44) have a single-line re-export.

Should go back to this for remix.init/functions/app/entry.server.tsx:

export { handleRequest as default } from "@netlify/remix-adapter";

And according to this guide, remix.init/edge/app/entry.server.tsx should be updated. Although the adapter also still has a remix-edge version of handleRequest which would conflict with the original version.

// @ts-expect-error virtual module
// eslint-disable-next-line import/no-unresolved
export { default } from "virtual:netlify-server-entry";

The old version for reference:

export { handleRequest as default } from "@netlify/remix-edge-adapter";