Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eve-next-node-eval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eve": patch
---

Importing `eve/next` from a `node -e` script, such as the loader `vercel dev` uses for `next.config.*`, no longer throws `ERR_INVALID_ARG_VALUE` for `"[eval]"`.
5 changes: 3 additions & 2 deletions packages/eve/src/internal/application/package.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync, realpathSync } from "node:fs";
import { createRequire } from "node:module";
import { basename, dirname, join } from "node:path";
import { basename, dirname, isAbsolute, join } from "node:path";
import { fileURLToPath } from "node:url";

import { readStampedPackageVersion } from "#internal/application/stamped-package-version.js";
Expand All @@ -24,7 +24,8 @@ interface PackageLocation {
}

function resolveCurrentModulePath(): string {
if (typeof __filename === "string") {
// In ESM this can read a global, such as the "[eval]" Node sets under `node -e`.
if (typeof __filename === "string" && isAbsolute(__filename)) {
return __filename;
}

Expand Down
Loading