contract emit crashes (CLI.UNEXPECTED, ERR_INVALID_ARG_VALUE) with the relative contract path that orm init scaffolds
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- node.js, typescript
調査の方向性
Start at cli-engine's loadConfig and trace how the relative contract path becomes projectRoot before validateContractDeps calls createRequire. Reproduce the default orm init scaffold and contract emit flow, then verify that the relative path works without ERR_INVALID_ARG_VALUE and that contract.json and contract.d.ts are emitted successfully.
索引モデルが issue の本文から書いたものです。
説明
Summary
orm init scaffolds prisma.config.ts with a relative contract path:
orm: ormConfig({
contract: "./src/prisma/contract.prisma",
db: { connection: process.env['DATABASE_URL']! },
}),
With that config, contract emit crashes:
CLI.UNEXPECTED: The argument 'filename' must be a file URL object, file URL string, or absolute path
string. Received './src/prisma/package.json' (ERR_INVALID_ARG_VALUE)
Changing the config to an absolute path (new URL('./src/prisma/contract.prisma', import.meta.url).pathname) makes the same command succeed and emit contract.json/contract.d.ts normally.
Where it breaks
In @prisma/[email protected] (dist ref-*.mjs), validateContractDeps does:
const resolve = createRequire(`${projectRoot}/package.json`);
and projectRoot arrives as the relative ./src/prisma derived from the config's contract path, but node:module's createRequire requires an absolute path or file URL. Either the config loader should absolutize contract against the config file's directory before handing it to the toolchain, or the toolchain should resolve projectRoot to an absolute path itself.
Filing here because the repro is entirely through prisma-cli commands and the config loader (cli-engine loadConfig) may be the layer that should absolutize; transfer to the ORM repo if it's purely an orm-toolchain fix.
Repro caveat
Reproduced on macOS / Node 24.11.1 with the rc.4 CLI shell and a locally patched @prisma/cli-engine built from repo HEAD, because the published engine crashes the CLI at startup (#202). I could not verify against a fully published stack for that reason. Today users hit this bug's surface anyway: orm init's final emit step fails with CLI.INIT_EMIT_FAILED due to #202, and once that is fixed, this crash is the next thing the default scaffold + contract emit flow runs into (unless the published engine absolutizes the path where the HEAD engine does not).
Found while validating the docs quickstart end to end (prisma/web#8151).
🤖 Filed with Claude Code on behalf of [email protected]
- 主要言語
- TypeScript
- スター
- 23
- フォーク
- 2
- 平均マージ
- 22時間 20分
- マージ済み PR(30日)
- 44
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prisma/prisma-cli のほかの issue
-
service logs --tail accepts negative and fractional numbers再び着手できるかも @somcpp が 14 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
prisma/prisma-cli#309 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
The update notice tells users to install @prisma/cli and does not recognise a global prisma installオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
prisma/prisma-cli#306 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
prisma/prisma-cli#305 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
prisma/prisma-cli#302 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
prisma/prisma-cli#300 ·
メンテナーはふだん 1 日以内に返信
prisma/prisma-cli の issue をすべて見る
似ている issue
-
by: ai-assisted frontend good-for: new-member spike
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Northeastern-Electric-Racing/Argos#847 ·
メンテナーはふだん 4 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
SignalK/freeboard-sk#990 ·
メンテナーはふだん 1 日以内に返信
-
[missing-inheritance] audit review (1 preset)対応中かも @github-actions が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
osmberlin/tagging-schema-browser#363 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Albert-Weasker/niubigeo#205 ·
メンテナーはふだん 1 日以内に返信
-
area/frontend area/v2 kind/bug priority/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
kubeflow/notebooks#1498 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信