fix(eve): fix eve dev schedule dispatch route 500 (vercel/eve#311)#745
Open
lzvxck wants to merge 1 commit into
Open
fix(eve): fix eve dev schedule dispatch route 500 (vercel/eve#311)#745lzvxck wants to merge 1 commit into
lzvxck wants to merge 1 commit into
Conversation
POST /eve/v1/dev/schedules/:id re-derived its module map loader path via resolvePackageSourceFilePath at request time, inside code Nitro had already bundled into .eve/nitro/dev/index.mjs. That function locates eve's own package root by walking up from the currently executing module's directory looking for an ancestor literally named dist, a walk that only succeeds unbundled. Once bundled, it silently resolved against the app's own package root instead of eve's, producing "Cannot find module '<projectRoot>/src/internal/authored- module-map-loader.ts'". Thread the artifacts config Nitro already resolves once at server build time through to dispatchScheduleInDev instead, matching how every other Nitro route in this codebase avoids the same request-time resolution. Signed-off-by: lzvxck <[email protected]>
Contributor
|
@lzvxck is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
POST /eve/v1/dev/schedules/:id(theeve devone-shot schedule dispatchroute) re-derived its module map loader path via
resolvePackageSourceFilePathat request time, inside code Nitro had alreadybundled into
.eve/nitro/dev/index.mjs. That function locates eve's ownpackage root by walking up from the currently executing module's directory
looking for an ancestor literally named
dist— a walk that only succeedswhen the code runs unbundled straight out of
node_modules/eve/dist. OnceNitro bundled it, no ancestor was named
dist, so the walk silently resolvedagainst the app's own package root instead of eve's, producing:
Fixes #311.
This fix threads the artifacts config Nitro already resolves once at
server-build time (in the unbundled host CLI process) through to
dispatchScheduleInDev, instead of letting it re-derive paths at requesttime from inside the bundle. This matches how every other Nitro route in
this codebase already avoids the same request-time resolution — the
schedule-dispatch route was the one place that didn't.
How did you test your changes?
pnpm typecheck,pnpm lint,pnpm fmt— all cleandev-schedule-dispatch.test.ts) to assert the handlerforwards the full artifacts config, not just
appRootdev-schedule-dispatch-route.scenario.test.ts, which boots a realeve devagainst an installed tarball build and assertsPOST /eve/v1/dev/schedules/:idreturns 200, not 500 — pins the exactDev schedule dispatch route 500s on Windows (cannot find authored-module-map-loader, backslash path) #311 failure mode
[email protected]install: theunpatched code reproduces the exact reported error byte-for-byte on
schedule dispatch; with the patch applied, bundle inspection of the
generated
.eve/nitro/dev/index.mjsconfirms the schedule-dispatch routeno longer calls
resolvePackageSourceFilePathat request time and insteaduses a build-time-baked
moduleMapLoaderPathliteral, same as every otherdev route
PR Checklist
CONTRIBUTING.mdevepackagegit commit --signoff)