Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Module build results in "error TS2307: Cannot find module or its corresponding type declarations."

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

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

評価

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

調査の方向性

リンクされた再現手順から始め、報告された環境で npm run prepack を実行します。module.ts、src/runtime/types/index.ts、および参照されている runtime/types と components/MyDiv.vue のパスを調査し、Vue モジュールを解決できない理由を追跡します。runtime types をエクスポートしながら、モジュールが TS2307 なしでビルドできれば完了です。

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

説明

Environment
  • Operating System: Windows_NT
  • Node Version: v20.10.0
  • Nuxt Version: 3.15.4
  • CLI Version: 3.21.1
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -
Reproduction

https://github.com/prof-schnitzel/nuxt-ts-bug-module/tree/main

Describe the bug

In my module.ts I have added the line export type * from './runtime/types' so that my nuxt module exports types that can be used in a consumer app. In the types file I only have this line: export * from '../components/MyDiv.vue'. But when running npm run prepack I get the error src/runtime/types/index.ts(1,15): error TS2307: Cannot find module '../components/MyDiv.vue' or its corresponding type declarations. Why? This seems to be a bug to me.

Additional context

No response

Logs

主要言語
TypeScript
スター
277
フォーク
36
平均マージ
4日 19時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

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

nuxt/module-builder のほかの issue

nuxt/module-builder の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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