Skip to content

Fix server build entry in template#3331

Merged
kdaviduik merged 5 commits intomainfrom
fd-fix-server-build-entry
Jan 6, 2026
Merged

Fix server build entry in template#3331
kdaviduik merged 5 commits intomainfrom
fd-fix-server-build-entry

Conversation

@frandiox
Copy link
Copy Markdown
Contributor

@frandiox frandiox commented Dec 11, 2025

The server build entry import was modified in the RR7 upgrade PR to be a dynamic import. I'm not sure why since it works as a static import as well. I've excluded this from ESLint to fix the errors.

🔴 Using a dynamic import means Vite needs to process your app code at runtime during the first request from your browser, which delays page rendering by a couple of seconds (you see a blank page for a while):

image

🟢 While a static import can be discovered by Vite earlier and preloaded in parallel to other work before your browser even opens:

image

@frandiox frandiox requested a review from kdaviduik December 11, 2025 04:24
@frandiox frandiox requested a review from a team as a code owner December 11, 2025 04:24
@shopify
Copy link
Copy Markdown
Contributor

shopify Bot commented Dec 11, 2025

Oxygen deployed a preview of your fd-fix-server-build-entry branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment December 11, 2025 9:50 AM
sitemap ✅ Successful (Logs) Preview deployment Inspect deployment December 11, 2025 9:51 AM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment December 11, 2025 9:51 AM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment December 11, 2025 9:51 AM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment December 11, 2025 9:51 AM

Learn more about Hydrogen's GitHub integration.

@kdaviduik kdaviduik merged commit 4e9d9ad into main Jan 6, 2026
17 checks passed
@kdaviduik kdaviduik deleted the fd-fix-server-build-entry branch January 6, 2026 23:21
@@ -1,4 +1,4 @@
// Virtual entry point for the app
import * as serverBuild from 'virtual:react-router/server-build';
import {createRequestHandler, storefrontRedirect} from '@shopify/hydrogen';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason the published version of @shopify/hydrogen does not export createRequestHandler (https://www.npmjs.com/package/@shopify/hydrogen/v/0.0.0-next-d9cd83b-20250521171221?activeTab=code)

i can see it was published a while ago, so maybe there was some caching or CI issues

the local version of the package works as expected (packages/hydrogen/dist/production/index.d.ts)

we might need to publish a patch if we intend on using this

i would:

  1. revert this change to the skeleton and revert o using import {createRequestHandler} from '@shopify/hydrogen/oxygen' (easier, hotfixy)
  2. investigate why the build did not include that, maybe it’s a change made and not released?
  3. isolate the skeleton’s node_modules in to ensure it does not use packages from the monorepo but instead from the published versions to avoid this kind of skew (tradeoff: cant ship new features and use them in the same PR)
  4. un-revert change to skeleton, import as is in the original code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason the published version of @shopify/hydrogen does not export createRequestHandler (https://www.npmjs.com/package/@shopify/hydrogen/v/0.0.0-next-d9cd83b-20250521171221?activeTab=code)

I think that's normal, we haven't released the new version yet. Why is that a problem though? New projects scaffolded via CLI should still use the old version 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants