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
(This step can also be e.g. config.build.rollupOptions.output.entryFileNames = '[name].js' in a config() hook in a Vite plugin, as in our case.)
npm run build
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 feels brittle 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) writing my SSR entrypoint to a different file, I'm (or said other Vite plugin is) responsible for knowing this. Other than this one hiccup — and #2497 — this does seem to work just fine.)
Actual Behavior
The build command throws ENOENT: no such file or directory dist/server/[name].js, because it assumes here that a string entryFileNames is a resolvable path when joined with serverOutDir.
What is the location of your example repository?
No response
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
(I can provide a failing test or example repo if it's useful. I just wanted to open this before I lose track of it.)
create-hydrogen
)vite.config.js
:(This step can also be e.g.
config.build.rollupOptions.output.entryFileNames = '[name].js'
in aconfig()
hook in a Vite plugin, as in our case.)npm run build
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 feels brittle 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) writing my SSR entrypoint to a different file, I'm (or said other Vite plugin is) responsible for knowing this. Other than this one hiccup — and #2497 — this does seem to work just fine.)
Actual Behavior
The build command throws
ENOENT: no such file or directory dist/server/[name].js
, because it assumes here that a stringentryFileNames
is a resolvable path when joined withserverOutDir
.I believe this is leaking assumptions from the internal Remix Vite implementation.
I can work around this by changing
"[name].js"
to() => "[name].js"
, but this feels pretty hacky!There are a few options for fixing this:
serverBuild
(the value resolved fromvite.build()
); it should be in there somewhereThanks!
The text was updated successfully, but these errors were encountered: