2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Nuxt × TypeScript プロジェクト作成時エラー(Cannot find module './index.vue?vue&type=script&lang=ts&')の解決方法

Posted at

Nuxt × TypeScript のプロジェクトを作成し、WEBブラウザで開いた時に
下記エラーが発生した場合の解決方法

Error:
Cannot find module './index.vue?vue&type=script&lang=ts&'

1.概要

npx create-nuxt-app プロジェクト名

言語の選択で "TypeScript" を選択

cd プロジェクト名
npm run dev

localhost:3000/ にアクセス

Errorが発生!

2.解決方法

ts-loaderのバージョンを変更

cd プロジェクト名
npm uninstall ts-loader
npm install ts-loader@8.2.0 

これで解決しました!!!

(もしくは、npmのバージョンを最新にする等々...)

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?