ES Modules Directory Import Not Supported

オープン
#907 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
build-system

調査の方向性

まず依存関係をインストールした後に pnpm build を実行して、失敗を再現します。packages/ui/uno.config.ts、packages/ui/theme/ ディレクトリ、および関連する tsconfig.json の設定を調査します。完了条件は、報告されたディレクトリインポートエラーなしでビルドが完了することです。

索引モデルが issue の本文から書いたものです。

説明

🐛 Build Error: ES Modules Directory Import Not Supported

Problem Description

pnpm build fails with ES Modules directory import error when building the project.

Error Details

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/path/to/devtools/packages/ui/theme' is not supported resolving ES modules imported from /path/to/devtools/packages/ui/uno.config.ts

Steps to Reproduce

  1. Clone the repository
  2. Run pnpm install
  3. Run pnpm build
  4. Observe the build failure

Expected vs Actual Behavior

Expected: The build should complete successfully without errors.

Actual: Build fails with directory import error due to missing file extensions in TypeScript import statements.

Environment Information

  • Node.js: v23.11.0
  • pnpm: 10.7.0
  • OS: Mac OS 15.5

Root Cause Analysis

ES Modules require explicit file extensions in import statements, but some imports in the codebase are missing .ts extensions, particularly in the UI package's theme configuration.

Proposed Solution

1. Update TypeScript Configuration

Add the following options to tsconfig.json:

{
  "compilerOptions": {
    "allowImportingTsExtensions": true,
    "noEmit": true
  }
}
2. Fix Import Statements

Update import statements to include explicit .ts extensions where needed, especially in:

  • packages/ui/theme/ directory imports
  • Related TypeScript module imports

Impact

This affects the build pipeline and prevents successful compilation of the packages. The issue is related to ES Modules import resolution in TypeScript configuration.

主要言語
TypeScript
スター
2.9k
フォーク
291
平均マージ
2日 48分
マージ済み PR(30日)
19

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vuejs/devtools のほかの issue

vuejs/devtools の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。