Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix instrumentation.js initialization in prod on Vercel (#48557)
If `this.serverOptions.dir` is `'.'` or missing (which seems to be the case in Vercel's `___next_launcher.cjs`), this code was calling `require(join('.', '.next', 'server', 'instrumentation'))` which is `require('.next/server/instrumentation')`; notably, require treats this differently from `require('./.next/server/instrumentation')`, which is actually what we need here. Use `path.resolve` instead so that we pass an absolute path to `require`, which I confirmed fixes the issue.
- Loading branch information