You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shopify hydrogen build (don't run npm run build; we've changed this as a workaround)
To provide a bit more context, I work at Netlify and we encountered this while building out support for Hydrogen Vite on our platform. As noted below, we have a workaround, but it isn't ideal and this could bite others in the future.
Expected Behavior
The site builds successfully. (The assumption is that since I'm (or some other Vite plugin is) customizing my SSR entrypoint configuration, I'm (or said other Vite plugin is) responsible for knowing this and handling it from end to end. Other than this one hiccup — and #2496 — this does seem to work just fine.)
Actual Behavior
The details here will vary depending on the specifics, but if you use the template linked above, you'll get:
Packaging Functions from .netlify/functions-internal directory:
- remix-server.mjs
✘ [ERROR] Could not resolve "./assets/server-build-BOKKiHSv.js"
What is the location of your example repository?
netlify/hydrogen-template@71145c9
Which package or tool is having this issue?
CLI
What version of that package or tool are you using?
@shopify/[email protected], @shopify/[email protected]
What version of Remix are you using?
2.11.2
Steps to Reproduce
create-hydrogen
)shopify hydrogen build
(don't runnpm run build
; we've changed this as a workaround)This is a bit vague, so here are some more concrete steps you can actually follow:
71145c98d6245d05012fd110bf88ab1c4e83a099
,npm i
pnpm i && pnpm build:packages
, then in the hydrogen template runnpm link ../remix-compute/packages/remix-edge-adapter
shopify hydrogen build
(don't runnpm run build
; we've changed this as a workaround)To provide a bit more context, I work at Netlify and we encountered this while building out support for Hydrogen Vite on our platform. As noted below, we have a workaround, but it isn't ideal and this could bite others in the future.
Expected Behavior
The site builds successfully. (The assumption is that since I'm (or some other Vite plugin is) customizing my SSR entrypoint configuration, I'm (or said other Vite plugin is) responsible for knowing this and handling it from end to end. Other than this one hiccup — and #2496 — this does seem to work just fine.)
Actual Behavior
The details here will vary depending on the specifics, but if you use the template linked above, you'll get:
This is because for some reason I don't quite grasp the hydrogen CLI build command deletes the
assets/
directory from the server build output directory after building. Maybe the command is assuming chunking has been disabled? I'm not really sure, but it seems to be a leaky assumption, perhaps related to the Oxygen platform.If I comment out this line inside my
node_modules
, everything works.For now, we're going to have our Netlify template and docs use
remix vite:build
instead ofshopify hydrogen build
as a workaround.Thanks!
The text was updated successfully, but these errors were encountered: