Skip to content

fix(eve): fix eve dev schedule dispatch route 500 (vercel/eve#311)#745

Open
lzvxck wants to merge 1 commit into
vercel:mainfrom
lzvxck:fix/eve-311-dev-schedule-dispatch-500
Open

fix(eve): fix eve dev schedule dispatch route 500 (vercel/eve#311)#745
lzvxck wants to merge 1 commit into
vercel:mainfrom
lzvxck:fix/eve-311-dev-schedule-dispatch-500

Conversation

@lzvxck

@lzvxck lzvxck commented Jul 13, 2026

Copy link
Copy Markdown

Description

POST /eve/v1/dev/schedules/:id (the eve dev one-shot schedule dispatch
route) 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
when the code runs unbundled straight out of node_modules/eve/dist. Once
Nitro bundled it, no ancestor was named dist, so the walk 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'
imported from '<projectRoot>/.eve/nitro/dev/index.mjs'

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 request
time 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 clean
  • Unit test updated (dev-schedule-dispatch.test.ts) to assert the handler
    forwards the full artifacts config, not just appRoot
  • Added dev-schedule-dispatch-route.scenario.test.ts, which boots a real
    eve dev against an installed tarball build and asserts
    POST /eve/v1/dev/schedules/:id returns 200, not 500 — pins the exact
    Dev schedule dispatch route 500s on Windows (cannot find authored-module-map-loader, backslash path) #311 failure mode
  • Manually verified against a real published [email protected] install: the
    unpatched 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.mjs confirms the schedule-dispatch route
    no longer calls resolvePackageSourceFilePath at request time and instead
    uses a build-time-baked moduleMapLoaderPath literal, same as every other
    dev route

PR Checklist

  • I linked an issue with prior discussion confirming this change is wanted
  • I ran the relevant checks from CONTRIBUTING.md
  • I added tests and documentation where relevant
  • I added a changeset if this touches the published eve package
  • DCO sign-off passes for every commit (git commit --signoff)

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]>
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@lzvxck is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev schedule dispatch route 500s on Windows (cannot find authored-module-map-loader, backslash path)

1 participant